ofc you may schedule it with cron but following script I wrote won’t change anything. The setting is set but nothing changes. I’m on Fedora Silverblue

edit:

solution

wallpath=/usr/local/share/backgrounds/Dynamic_Wallpapers
image=$(find $wallpath -name "*.xml" | grep -E xml | sort -R | tail -1)
image="file:///$image"
echo $image

gsettings set org.gnome.desktop.background picture-uri "$image"
gsettings set org.gnome.desktop.background picture-uri-dark "$image"

and crontab

@daily ~/wallpaper_changer.sh
@reboot ~/wallpaper_changer.sh
  • fortified_banana@beehaw.org
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    1 year ago

    I’m not sure about using xml files, but there’s also a ‘picture-uri-dark’ key you need to set instead if you’re using dark mode. I have a similar setup with a systemd user timer that runs every 5 minutes.

    Edit: I just tried it out in the terminal and it works ok for xml files, too. Also, I try to avoid parsing the output of ls in scripts. You can use find instead, something like

    find $wallpath -name '*.xml'
    

    should work.