# 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, rename your photos according to this table *Suppose the filename is example.jpg* |Accent Color |Suffix |Expected filename | |--------------|-------|-------------------| |Blue |blue |example-blue.jpg | |Teal |teal |example-teal.jpg | |Green |gree |example-gree.jpg | |Yellow |yell |example-yell.jpg | |Red |redd |example-redd.jpg | |Pink |pink |example-pink.jpg | |Purple |purp |example-purp.jpg | |Slate |- |*any file without valid suffix above*| *This means if there is no valid color suffix at the end of file name, we will set the accent color to Slate.* 3. In `change-wallpaper.py`, replace the `directory_path` with the path from step 1 4. Put `change-wallpaper.py` to `~/.local/bin` and make sure it is in your `$PATH` 5. In `change-wallpaper.service` replace `youruser` in `ExecStart` line with your actual username. 6. **Optionally**, modify `change-wallpaper.timer` as needed. The default is set to *every 15 minutes*. 7. 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 ```