Fixed it so that it actually works.

master
Robert Zenz 2014-05-19 21:44:32 +02:00
parent e6ff8fe9ba
commit 6d60780f1e
1 changed files with 11 additions and 7 deletions

View File

@ -5,24 +5,28 @@
# Public Domain or CC0
function setGnomeGConf() {
gconftool -t str -s /desktop/gnome/background/picture_filename $1
setGnomeGConf() {
gconftool -t str -s /desktop/gnome/background/picture_filename "$1"
}
function setMateConf() {
mateconftool-2 -t str -s /desktop/mate/background/picture_filename $1
setMateConf() {
mateconftool-2 -t str -s /desktop/mate/background/picture_filename "$1"
}
function setMateDConf() {
dconf write /org/mate/desktop/background/picture-filename $1
setMateDConf() {
dconf write /org/mate/desktop/background/picture-filename "'$1'"
}
# Directory of the wallpapers
wallpaperdir=~/Wallpapers
# Time between changes
sleep=3m
if [ ! -d "$wallpaperdir" ]; then
echo "$wallpaperdir does not exist!"
exit 1
fi
newWallpaper=$(ls "$wallpaperdir" | sort --random-sort | head -n 1)
@ -32,4 +36,4 @@ setMateDConf "$wallpaperdir/$newWallpaper"
# Wait for some time and then start over.
# If you want a "one shot solution" remove the next two lines.
sleep $sleep
exec $0
exec "$0"