How to change an xml wallpaper every day?

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


<span style="color:#323232;">wallpath=/usr/local/share/backgrounds/Dynamic_Wallpapers
</span><span style="color:#323232;">image=$(find $wallpath -name "*.xml" | grep -E xml | sort -R | tail -1)
</span><span style="color:#323232;">image="file:///$image"
</span><span style="color:#323232;">echo $image
</span><span style="color:#323232;">
</span><span style="color:#323232;">gsettings set org.gnome.desktop.background picture-uri "$image"
</span><span style="color:#323232;">gsettings set org.gnome.desktop.background picture-uri-dark "$image"
</span>

and crontab


<span style="color:#323232;">@daily ~/wallpaper_changer.sh
</span><span style="color:#323232;">@reboot ~/wallpaper_changer.sh
</span>
selokichtli,

I use a while true approach with sleep 24h or whatever. Doesn’t seem to impact my CPU usage, but I guess the crontab approach is more Unix-like.

Chais,
@Chais@sh.itjust.works avatar

This might work.

fortified_banana, (edited )

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


<span style="color:#323232;">find $wallpath -name '*.xml'
</span>

should work.

beta_tester,

Nice! It worked. Thank you so much!

db2,

Plot twist: OP uses KDE

beta_tester,

Nice one

atlasraven31,

Are ypu dead set on using xml or did you want to try a Wallpaper app like Variety?

beta_tester,

Dynamic wallpapers are cool

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • [email protected]
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • oklahoma
  • Socialism
  • KbinCafe
  • TheResearchGuardian
  • Ask_kbincafe
  • SuperSentai
  • feritale
  • KamenRider
  • All magazines