Change wallpaper via ssh
5,904
I think you can try the following:
ssh user@remotehost
Once you are logged in the remote host you need to export the "Display" so you can search it with this.
env | grep 'DISPLAY'
The result is:
DISPLAY=:0
Now you can export the DISPLAY.
export DISPLAY=:0
Then you can set the background.
gsettings set org.gnome.desktop.background picture-uri "file:///tmp/ozvsk.jpg"
Cheers.
Related videos on Youtube
Author by
Prem
Updated on September 18, 2022Comments
-
Prem over 1 year
I have a server running
12.04 32bit
.I would like to change the wallpaper via an
ssh
connection.I tried the following command, but it didn't change the wallpaper. The command works if I am on the server (physically sat down with a keyboard and monitor connected), but not via an
ssh
connection.gsettings set org.gnome.desktop.background picture-uri "file:///tmp/ozvsk.jpg"
Any ideas?
-
ImaginaryRobots over 11 yearsare you getting any particular error? What is the full ssh command that you are using?
-
-
Sergey almost 11 years
env | grep 'DISPLAY'
is empty for me. When Iexport DISPLAY=:0
and executegsettings ...
nothing happens -
Roman Raguet almost 11 yearsif you want to do ssh on localhost, try this: ssh -X [email protected], then you can search the Display with env | grep 'DISPLAY' (eg: DISPLAY=localhost:10.0). Finally use the gsettings: gsettings set org.gnome.desktop.background picture-uri "file:///home/user/wallpaper.jpg". Hope this will be helpful.