Skip to content

Instantly share code, notes, and snippets.

@eliperelman
Created March 14, 2014 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliperelman/9539770 to your computer and use it in GitHub Desktop.
Save eliperelman/9539770 to your computer and use it in GitHub Desktop.
OS X: Bash function to change the desktop wallpaper across all monitors and spaces. Tested on Mavericks.
# Usage:
# wallpaper path/to/image.png
function wallpaper() {
image=`echo $(cd $(dirname $1); pwd)/$(basename $1)`
cd /System/Library/CoreServices
sudo rm -f DefaultDesktop.jpg
sudo ln -sf $image DefaultDesktop.jpg
sudo rm ~/Library/Application\ Support/Dock/desktoppicture.db
killall Dock
cd -
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment