Skip to content

Instantly share code, notes, and snippets.

@EdgeCaseBerg
Created July 15, 2013 14:30
Show Gist options
  • Save EdgeCaseBerg/6000400 to your computer and use it in GitHub Desktop.
Save EdgeCaseBerg/6000400 to your computer and use it in GitHub Desktop.
background cycler. Listen to system events (Such as screenshots, moving between workspaces, log on and log off) and change the background to a random one from an images directory. I've only used it on my system (Linux 3.2.0-23-generic #36-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux -- Linux Mint 13 with maya) and I'm pretty sure it probably doesn'…
#!/bin/bash
#Script to change background image randomly when switching workspaces
#image directories:
dbus-monitor --profile "path='/org/mate/panel/applet/WindowListApplet/1'" |
while read -r msg; do
#echo $msg
if [ "" != msg ];
then
PIC=$(ls ~/Pictures/ | shuf -n1)
mateconftool-2 -t string -s /desktop/mate/background/picture_filename ~/Pictures/$PIC
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment