Desktop wallpaper switcher for Linux Mint

Those of you who have used Mac know that having ability to set different wallpapers for each of your workspaces is a nice feature.

Unfortunately such feature is not [always] available in Linux.

But, turns out that you can easily add this feature on your own.

Your system already has the utility xprop, which allows you to monitor your desktop parameters, and gsettings, which let you change desktop configuration on the fly. You just need a simple script to tie all that together. Feel free to copy the code below:

 # This script runs in background, waiting for you to switch to
 # another workspace, so that it can change the desktop wallpaper
 # accordingly when you do.
 # Tested on Linux Mint 18 Mate
 # Script by crcok from:
 # Based on the script by garolou from:
 # If you know how to make Linux Mint Mate display a different set
 # of desktop icons for each of the workspaces, please come to
 # and share your ideas in comments.

# Edit this. Your wallpaper directory. Don't forget the trailing slash.

# Edit this. Wallpaper image file names. One for each workspace you are using.

# This is a function nicely encapsulating a call to the desktop.
 # Note that it is Mate and not Gnome we are talking to here.
 setdesktop() {
 gsettings set org.mate.background picture-filename "$desktop_dir$1"

# The main loop. Every time you change to another workspace,
 # xpropr will output its number and thus will trigger the change.
 xprop -root -spy _NET_CURRENT_DESKTOP | (
 while read -r; do
 setdesktop ${desktop_img[$desk]}

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s