Randomly pick a wallpaper for your GNOME desktop, without any shell extensions.
Find a file
2025-05-16 02:23:34 +07:00
change-wallpaper.desktop Add desktop file 2025-05-16 02:23:34 +07:00
change-wallpaper.py Improve filename handling and do not hardcode paths 2025-05-16 02:00:49 +07:00
change-wallpaper.service Add path example in service unit file 2025-05-16 02:03:16 +07:00
change-wallpaper.svg add icon 2025-05-16 00:30:24 +07:00
change-wallpaper.timer Add files 2025-02-04 01:51:58 +07:00
LICENSE Initial commit 2025-02-03 18:10:40 +00:00
README.md update README to match the new innerworkings 2025-05-16 02:10:55 +07:00

Random Wallpaper for GNOME

A Python script to pick a random photo from the specified directory, set the wallpaper (for both light and dark) and the accent color.

Why does this exist

We'd like to change our wallpaper every 15 minutes and automatically set a pre-defined accent color for each photo. There are many GNOME Shell extensions out there that can do something similar, but we simply want to achieve the same effect without using any extensions, especially when upgrading to a pre-release GNOME version that many extensions don't support yet.

So instead of a GNOME Shell extension, we created a Python script that does everything via gsettings and hook it up to a systemd timer instead.

How to use

  1. Create a directory with desired photos and note its full path
  2. In that directory, append color codes to the files such as from example.jpg to example-blue.jpg. Possible color codes are blue, teal, green, yellow, orange, red, pink and purple. If other colors are set or there is no color code at all, we'll set the color to neutral slate.
  3. Put change-wallpaper.py to ~/.local/bin and make sure it is in your $PATH
  4. In change-wallpaper.service replace /path/to/dir accordingly.
  5. Optionally, modify change-wallpaper.timer as needed. The default is set to every 15 minutes.
  6. Put change-wallpaper.service and change-wallpaper.timer in ~/.config/systemd/user/ and run these commands to get started
$ systemctl --user daemon-reload
$ systemctl --user enable --now change-wallpaper