Created
June 22, 2011 11:06
-
-
Save zuzkins/1039883 to your computer and use it in GitHub Desktop.
My once lost now found wallpaper changing script for GNOME like desktops (works in Unity too)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export $(xargs -n 1 -0 echo </proc/$(pidof gnome-session)/environ | grep -Z DBUS_SESSION_BUS_ADDRESS=) | |
#DISPLAY=:0 | |
WALLPAPERS="BIG_WALLPAPER_COLLECTION_DIR" | |
ALIST=( `ls -w1 $WALLPAPERS` ) | |
RANGE=${#ALIST[@]} | |
let "number = $RANDOM" | |
let LASTNUM="`cat $WALLPAPERS/.last` + $number" | |
let "number = $LASTNUM % $RANGE" | |
/usr/bin/gconftool-2 -t string -s "/desktop/gnome/background/picture_filename" "$WALLPAPERS/${ALIST[$number]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment