Change Wallpaper via Ssh

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?

1

1 Answer

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.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.

Share this article
Twitter Facebook Pinterest