<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=362909&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / [Feh] et taille des images [résolu]]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=362909</link>
		<description><![CDATA[Les sujets les plus récents dans [Feh] et taille des images [résolu].]]></description>
		<lastBuildDate>Tue, 01 Dec 2009 20:17:21 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[[Feh] et taille des images [résolu]]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=3110335#p3110335</link>
			<description><![CDATA[<p>Bonjour,<br />Afficher une image aléatoirement au format 1280x1024 et supérieur à l&#039;aide de feh (option background) pour openbox et version allégée.</p><div class="codebox"><pre class="vscroll"><code>#!/bin/bash
# Wallpaper aleatoire avec feh
# Trie les images par taille définir par la résolution
# de l&#039;écran voir les variables à éditer
# dependance:
# feh
# (optionnel):
# notify-send
###########

while true; do
#=====================
# EDIT PLS
#=====================
# Répertoire d&#039;image:
WALLPAPER=/dossier/images/
# Taille de votre écran:
LONGUEUR=1280
HAUTEUR=1024

#=====================
# DON&#039;T EDIT
#=====================

#=====================
# VERIFICATION 
#=====================

if [ ! -f &quot;/usr/bin/feh&quot; ]; then
echo &quot;Veuillez installer feh&quot;
notify-send -u critical ERREUR &quot;Veuillez installer ce programme: feh&quot;
exit 1
fi

if [ ! -d &quot;$WALLPAPER&quot; ]; then
echo &quot;le dossier $WALLPAPER n&#039;existe pas&quot;
notify-send -u low ERREUR &quot;le dossier $WALLPAPER n&#039;existe pas&quot;
exit 1
fi

IMAGE=`find &quot;$WALLPAPER&quot; -type f -name &#039;*.jpg&#039; -o -name &#039;*.png&#039; | shuf -n 1`
WIDTH=`feh -l &quot;$IMAGE&quot; | grep 1 | awk &#039;{print $3}&#039;`
HEIGHT=`feh -l &quot;$IMAGE&quot; | grep 1 | awk &#039;{print $4}&#039;`

vLONGUEUR=$(($LONGUEUR -1))
vHAUTEUR=$(($HAUTEUR -1))

if [ &quot;$WIDTH&quot; -gt &quot;$vLONGUEUR&quot; ] &amp;&amp; [ &quot;$HEIGHT&quot; -gt &quot;$vHAUTEUR&quot; ]; then
{
echo &quot;Image acceptée: &quot;$IMAGE&quot; :&quot;
echo &quot;&quot;$WIDTH&quot; x &quot;$HEIGHT&quot; pixels&quot;
feh --bg-scale &quot;$IMAGE&quot;
sleep 1m
}
else
{
echo &quot;Image refusée: &quot;$IMAGE&quot; :&quot;
echo &quot;&quot;$WIDTH&quot; x &quot;$HEIGHT&quot; pixels&quot;
}
fi
done</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (wido)]]></author>
			<pubDate>Tue, 01 Dec 2009 20:17:21 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=3110335#p3110335</guid>
		</item>
	</channel>
</rss>
