Automatically Change GNOME Wallpaper Every 30 Minutes with a systemd Timer
If you already have a script that randomly changes your GNOME wallpaper, you can use a systemd user timer to run it automatically at regular intervals.
In this example, the wallpaper will be changed every 30 minutes.
How it works
A systemd timer does not run the wallpaper script directly. Instead, the timer activates a systemd service, and the service runs the script:
wallpaper.timer
│
│ every 30 minutes
▼
wallpaper.service
│
▼
random_wallpaper_gnome_v2.sh
│
▼
GNOME wallpaper changesWe will create two files:
wallpaper.service— defines what should be executed.wallpaper.timer— defines when the service should be executed.
This example uses a user systemd service, so everything is managed with systemctl --user.
Prerequisites
This tutorial assumes that you already have a script that changes your GNOME wallpaper.
For example:
/path/to/script/random_wallpaper_gnome_v2.shMake sure the script is executable:
chmod +x /path/to/script/random_wallpaper_gnome_v2.shReplace the path above with the actual location of your script.
Create the systemd user directory
Create the directory for user systemd units if it does not already exist:
mkdir -p ~/.config/systemd/userWe will create the following files:
~/.config/systemd/user/
├── wallpaper.service
└── wallpaper.timerCreate the systemd service
Create:
~/.config/systemd/user/wallpaper.servicewith the following content:
[Unit]
Description=Change GNOME wallpaper
[Service]
Type=oneshot
ExecStart=/path/to/script/random_wallpaper_gnome_v2.shChange ExecStart to the actual path of your wallpaper script.
The important part here is:
Type=oneshotThe service performs one task and then exits. It is therefore a good fit for a script that changes the wallpaper once and finishes.
Create the systemd timer
Next, create:
~/.config/systemd/user/wallpaper.timerwith:
[Unit]
Description=Change GNOME wallpaper every 30 minutes
[Timer]
OnActiveSec=30min
OnUnitActiveSec=30min
Unit=wallpaper.service
[Install]
WantedBy=timers.targetThere are two important settings here.
OnActiveSec
OnActiveSec=30minThis waits 30 minutes after the timer becomes active before the first execution.
OnUnitActiveSec
OnUnitActiveSec=30minThis schedules the next execution 30 minutes after the associated service was last activated.
Therefore, the timer behaves approximately like this:
Timer starts
│
│ 30 minutes
▼
Run wallpaper.service
│
│ 30 minutes
▼
Run wallpaper.service
│
│ 30 minutes
▼
Run wallpaper.service
│
...Reload systemd
After creating or modifying the unit files, tell systemd to reload them:
systemctl --user daemon-reloadEnable and start the timer
Enable the timer so it starts automatically with your user systemd session:
systemctl --user enable wallpaper.timerThen start it:
systemctl --user start wallpaper.timerOr, equivalently, enable and start it in one command:
systemctl --user enable --now wallpaper.timerYou can now check its status:
systemctl --user status wallpaper.timerCheck the scheduled time
The list-timers command is useful for seeing when the timer last ran and when it will run next:
systemctl --user list-timersYou should see an entry similar to:
NEXT LEFT LAST
Wed 2026-08-26 16:30:00 ... 20min Wed 2026-08-26 16:00:00 ...The exact times will depend on when you started the timer.
Test the wallpaper service manually
You don’t have to wait 30 minutes to test whether the service works.
Run it manually:
systemctl --user start wallpaper.serviceIf the wallpaper changes, the service and your script are working correctly.
If it doesn’t, you can check the service logs:
journalctl --user -u wallpaper.serviceFor a more detailed view of recent messages:
journalctl --user -u wallpaper.service -n 50This is also a useful way to diagnose problems with the wallpaper script itself.
Timer vs. service
It’s useful to understand why there are two files.
The service describes the action:
[Service]
Type=oneshot
ExecStart=/path/to/script/random_wallpaper_gnome_v2.shThe timer describes the schedule:
[Timer]
OnActiveSec=30min
OnUnitActiveSec=30minThis separation is one of the useful features of systemd. The same service could potentially be triggered manually, by a timer, or by another systemd unit.
Run at fixed times instead
The configuration above uses a relative interval: the next execution occurs 30 minutes after the previous activation.
If you instead want the wallpaper to change at fixed times, such as:
10:00
10:30
11:00
11:30
12:00
...you can use OnCalendar instead.
For example:
[Timer]
OnCalendar=*:0/30
Unit=wallpaper.serviceThis is different from OnActiveSec/OnUnitActiveSec because the schedule is based on calendar time rather than the time when the timer or service was activated.
For a simple “every 30 minutes after I start the timer” behavior, the original configuration is sufficient.
Disable the timer
If you want to stop the automatic wallpaper changes:
systemctl --user disable --now wallpaper.timerThe service and timer files can remain in place. You can enable the timer again later with:
systemctl --user enable --now wallpaper.timerRemove the timer completely
If you no longer need the timer, first stop and disable it:
systemctl --user disable --now wallpaper.timerThen remove the unit files:
rm ~/.config/systemd/user/wallpaper.timer
rm ~/.config/systemd/user/wallpaper.serviceFinally, reload systemd:
systemctl --user daemon-reloadTroubleshooting
If the timer doesn’t appear to work, check the following.
1. Verify that the timer is running
systemctl --user status wallpaper.timer2. Check the timer schedule
systemctl --user list-timers3. Run the service manually
systemctl --user start wallpaper.serviceIf this fails, the problem is probably with the service configuration or wallpaper script rather than the timer.
4. Check the service log
journalctl --user -u wallpaper.service5. Check that the script is executable
ls -l /path/to/script/random_wallpaper_gnome_v2.shIf necessary:
chmod +x /path/to/script/random_wallpaper_gnome_v2.shConclusion
A systemd user timer is a simple way to periodically run a wallpaper-changing script without keeping another program running in the background.
The basic setup consists of:
wallpaper.service
└── runs the wallpaper script
wallpaper.timer
└── starts wallpaper.service every 30 minutesOnce the timer is enabled, systemd takes care of running the script automatically.
If you already have a script that changes your GNOME wallpaper, this approach lets you turn it into a fully automated wallpaper rotation with only a couple of systemd unit files.