First of all, make sure the file path is correct. Execute this line in a terminal:
ls /home/user/Pictures/wallpapers/X
Did the file get listed? If so, move on to the next step.
Make sure that you know where the gsettings
command is. In the terminal, run:
which gsettings
That should get you the full path to gsettings
. If nothing is displayed, the directory containing gsettings
isn't in your $PATH
variable.
Let's say the path is /usr/bin/gsettings
.
Try to execute this in a terminal:
/usr/bin/gsettings set org.gnome.desktop.background picture-uri /home/user/Pictures/wallpapers/X
If it works, pass the same string to os.system()
:
import os
os.system("/usr/bin/gsettings set org.gnome.desktop.background picture-uri /home/user/Pictures/wallpapers/X")