Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 12589  / 2 Years ago, fri, may 27, 2022, 4:13:23

I wrote a little python script, that downloads a random astronomy picture of the day and then sets it as the desktop wallpaper.



When i was on Ubuntu 13.10 with gnome installed this script used to work fine, and i had it change my background via cronjob every few hours and it worked well.



However, now I have installed Ubuntu Gnome 13.10 and it behaves very strangely. The download works well, every time I run the script a new picture is being downloaded. However it only changes the wallpaper on the first time after a fresh start/ fresh log in. Starting with the second execution there's an ''animation'' on the desktop (turning blueish) but the wallpaper stays the same even though there's a different picture saved in my wallpaper directory. When i log out and back in again, the new picture appears as the wallpaper.



Does anyone know what may cause it? I've found this and implemented it, but it changed nothing. Also I think it is not related to crontab, because it also fails by manual execution.



The command used to set the wallpaper is the following



gsettings set org.gnome.desktop.background picture-uri file:///path/to/file.jpg


EDIT: The command above is the only relevant part, since executing it directly via terminal produces the same behavior.


More From » gnome

 Answers
0

Trying a little bit and reading about the bug I figured out a really simple workaround.



You will have to sandwitch your "picture-url" command disabling and enabling againg the draw-background entry. Basically, your line should look like this:



gsettings set org.gnome.desktop.background draw-background false && gsettings set org.gnome.desktop.background picture-uri file:///home/$USER/Imágenes/pic.jpg && gsettings set org.gnome.desktop.background draw-background true


I've just made a one-liner that do gsettings set org.gnome.desktop.background draw-background false change the wall and then activate the entry again. :)



It works like a charm! Thanks for the question! ^_^


[#27079] Friday, May 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
velelf

Total Points: 395
Total Questions: 115
Total Answers: 107

Location: Sudan
Member since Mon, Jun 1, 2020
4 Years ago
;