, I use that thread all the time. Very nice.
And thanks, Never even heard of the watch command before, not a big CL person. Going to try and use it myself, don't know if I can, but will try.
So, I did a little research, and sorta got one started. Though I didn't use the watch command, just du and if test then
Code:
#/bin/bash
z2=0
while :
do
z1=$(du /path/to/image.png | head -c 3)
if test [$z1 != $z2]; then
pcmanfm --set-wallpaper=/path/to/image.png
sleep 120
fi
z2=$(du /path/to/image.png | head -c 3)
sleep 10
done
But it is never equal, even when it should. As I said, not good as scripts, first time trying variables, so I am sure it is just my stupidity.
Any help?
Well, I got it figgered out. Here is the working code for anyone
Code:
#/bin/bash
while :
do
z1=$(du /path/to/image.png | head -c 3) # set z1 as the first 3 numbers in a filesize
if test $z1 -ne $z2; then
pcmanfm --set-wallpaper=/path/to/image.png
z2=$(du /path/to/image.png | head -c 3) # set z2 as the first 3 numbers in a filesize
sleep 120
else
z2=$(du /path/to/image.png | head -c 3) # set z2 as the first 3 numbers in a filesize
sleep 5
fi
done
Not pretty, I am sure, but it works.
Bookmarks