Less switchy wallpaper switcher?

In looking for my own solution to this, I found no shortage of applications that'll download wallpapers, rotate them every x minutes, yada yada. I don't need all that. I'm fine with additional features being included, but all I really want is a tool that will, at a given time, set my wallpaper to a specific image. If it'll let me set different times/images by day of the week, even better. The use case is simple: One image for work hours, one image for outside work hours. Possibly another set for weekends. As far as I can tell, Zorin's included tools don't do this unless you choose to switch light/dark mode too, and I only use dark mode. (I also don't recall an option to set a time.)

So far, the closest I've come was a suggestion to use a cron job and gsettings to change the wallpaper, but that's a bit less polished than I'm hoping for, even if it would be good experience for me. So, anyone know of a tool that'll set user specified wallpapers on a user defined schedule, rather than rotating at intervals?

If you want to switch to KDE (sooner or later), it's quite easy:

That's... actually exactly what I don't want. That changes at intervals, rather than at scheduled times.

Edit: If my work hours and non-work hours were equal, I could use intervals anyway, but since some intervals would be longer or shorter than others, it just doesn't fit the bill. Thanks though.

So you want work hours to X wallpapers and Y wallpaper when non-working?

EDIT found this for KDE:

#!/bin/bash

export DISPLAY=:1
export XAUTHORITY="/home/$USER/.Xauthority"
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"

# Start and end of working hours (24 hour format)
WORK_HOUR_START="9"
WORK_HOUR_END="18"
# Start and end of working weekdays (1 = monday, 7 = sunday)
WORK_DAY_START="1"
WORK_DAY_END="5"
# Paths for work / private wallpapers
PATH_WORK="/home/$USER/Pictures/Wallpaper/Work"
PATH_PRIVATE="/home/$USER/Pictures/Wallpaper/Private"

WEEKDAY=`date +%u`
HOUR=`date +%H`
FILE_PATH="$PATH_WORK"
FILE_NAME=`ls $PATH_WORK | sort -R | head -n 1`

if [ "$WEEKDAY" -lt "$WORK_DAY_START" ] || [ "$WEEKDAY" -gt "$WORK_DAY_END" ] || [ "$HOUR" -lt "$WORK_HOUR_START" ] || [ "$HOUR" -ge "$WORK_HOUR_END" ]; then
	FILE_PATH="$PATH_PRIVATE"
	FILE_NAME=`ls $PATH_PRIVATE | sort -R | head -n 1`
fi

# Debugging output
#echo "DB: $DBUS_SESSION_BUS_ADDRESS"
#echo "WD: $WEEKDAY"
#echo "HR: $HOUR"
#echo "FN: $FILENAME"

dbus-send --session --dest=org.kde.plasmashell --type=method_call /PlasmaShell org.kde.PlasmaShell.evaluateScript "string:
var Desktops = desktops();
for (i=0;i<Desktops.length; i++) {
        d = Desktops[i];
        d.wallpaperPlugin = 'org.kde.image';
        d.currentConfigGroup = Array('Wallpaper', 'org.kde.image', 'General');
        d.writeConfig('Image', 'file://$FILE_PATH/$FILE_NAME');
1 Like

That looks like it could do the job, yes. I think. I don't know bash scripting, but it seems plausible. :slight_smile: I'm using GNOME still due to Zorin's inability to use Plasma 6, but I could probably hop to Tuxedo OS and give this a try next week. (Tuxedo OS is also Ubuntu based, but moved to 24.04.) Thanks!

I'll leave the thread open for a day or two in case someone knows of an app that does the job without playing with a script, but if nothing turns up, I'll mark the script as a solution.

1 Like

What Programs did You already tried for this?

I've found a Gnome Extension for switching Wallpapers what You could try: Wallpaper Switcher - GNOME Shell Extensions

In the Software Store, You can find several Wallpaper Manager, too. For Example:

  • HydraPaper
  • Wallpaper downloader
  • Wallpaper Selector
  • Wonderwall
  • Variety

I saw a Video to Variety. Maybe that would be a good Point to start to try.

The Gnome extension you linked uses a timer to switch wallpapers, which again, doesn't really work, since workday and non-work would need different durations.

  • HydraPaper doesn't act as a switcher at all; it just lets you manually set different wallpapers on each monitor.
  • Wallpaper downloader only changes at fixed intervals, not based on time of day.
  • Wallpaper selector doesn't switch wallpapers, it just provides a UI to set wallpapers from a single site called Wallhaven.
  • Wonderwall doesn't act as a switcher at all; it just searches online libraries of wallpapers to provide a large selection.
  • Variety does switch wallpapers, but again, only at fixed intervals, not based on time of day.

What I'm trying to find really does seem to be a surprising (at least to me) gap in the features of this sort of utility.

Its been a while since I tried to add this functionality back into Gnome, as previous versions had this option, but I believe this should still work in Zorin 17 (albeit, again, haven't tried in a bit since every time an update came, something broke and I had to fix it, so I just gave up)

Even though that's not ideally what you're looking for, it used to work. I might take a look later when I have time and try to write something up that can basically do the functionality you're looking for, ideally.

1 Like

Hello,
You can also launch different bash with timers.
The simple bash

#!/usr/bin/env bash

WALLPAPER_DIR="/home/work/Pictures/Wallpaper"
RANDOM_PICTURE=$(ls $WALLPAPER_DIR -1 | shuf -n 1)

gsettings set org.gnome.desktop.background picture-options "zoom"
gsettings set org.gnome.desktop.background picture-uri "file://$WALLPAPER_DIR/$RANDOM_PICTURE"

if you want to use crontab and not timers you need to add this line at the beginning of the script

PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)

here is a good explain for timers
https://documentation.suse.com/smart/systems-management/html/systemd-working-with-timers/index.html

1 Like