Run custom commands on wallpaper change

Created by Peter Levi on
custom commands set_wallpaper

Every time the wallpaper changes, the script ~/.config/variety/scripts/set_wallpaper is run, passing the full path to the new wallpaper as an argument. You can edit this file to your will, running any sort of custom commands on wallpaper change. From the comments in the script:

This script is run by Variety when a new wallpaper is set.
The first passed parameter (accessed with $1) is the absolute path to the wallpaper.
The second passed parameter ($2) is "auto" when the wallpaper is changed automatically (i.e. regular change) and "manual" otherwise - e.g. when the user clicks Previous, Next or Trash.
You can use bash, python or whatever suits you for the script.
Here you can put custom commands for setting the wallpaper on your specific desktop environment or run commands like notify-send to notify you of the change, or you can run commands that would theme your browser, login screen or whatever you desire.