Although I could not test it, due to the fact that I don't have Mate avaialble atm, looking at the output of
wmctrl -d, and given the fact that wallpapers on Mate are obviously set with the same
gsettings command, I see no reason why it should not work.
The script below is an edited version of this one, and kind of an exerpt of the one I pushed to Launchpad. As it is, that one won't work for Mate, since I added a session-check in that one, for either Unity or Budgie.
If you can confirm the script below works on Mate, I'll probably edit the ppa version to include Mate.
workspace_data = os.environ["HOME"]+"/.config/wswitcher/wallpaper_data_"
key = [
"gsettings get ",
"gsettings set ",
["/bin/bash", "-c", key+key]
# get resolution
xr = subprocess.check_output(["xrandr"]).decode("utf-8").split()
pos = xr.index("current")
return [int(xr[pos+1]), int(xr[pos+3].replace(",", "") )]
# get the current workspace
wsdata = subprocess.check_output(["wmctrl", "-d"]).decode("utf-8").splitlines()
return [l.split() for l in wsdata if "*" in l]
def wswitcher(curr_ws1, currwall1):
currwall2 = getwall()
curr_ws2 = current_ws()
datafile = workspace_data+curr_ws2
if curr_ws2 == curr_ws1:
if currwall2 != currwall1:
if not os.path.exists(datafile):
curr_set = open(datafile).read()
command = key+key+' "'+str(curr_set)+'"'
subprocess.Popen(["/bin/bash", "-c", command])
curr_ws1 = curr_ws2
currwall1 = getwall()
curr_ws1 = current_ws(); currwall1 = getwall()
How to use
- Copy the script into an empty file
- Save it as
Test- run it by the command:
- Then simply start setting up your wallpapers as demonstrated here.
If all works fine, add it to Startup Applications:
/bin/bash -c "sleep 10 && /path/to/wallswitcher.py