1

I am currently in a learning program. We are asked to download a specific image and then use it as wallpaper, doing so form the command line. The directions given yields nothing:

First we have to download an image, and then we will use the command to make it our background.

$ wget -O ~/Downloads/wallpaper.jpg  "https://raw.githubusercontent.com/hoppersroppers/hoppersroppers.github.io/main/_layouts/constitution.jpg"

$ gsettings set org.gnome.desktop.background picture-uri file:////tmp/wallpaper.jpg

Now your background image should be a picture of a ship! If it didn't work, troubleshoot.

https://linuxhandbook.com/get-file-path/#Use%20The%20Find%20Command%20to%20Get%20The%20Absolute%20File%20Path

https://www.baeldung.com/linux/change-desktop-wallpaper-from-terminal primarily because C/P the commands as given yields no change. I am figuring this is a "test". I don't understand why its directing to tmp if the image is in downloads?

ob@adminbaby:~/Desktop$  wmctrl -m
Name: GNOME Shell
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF

bob@adminbaby:~/Desktop$ gsettings set org.gnome.desktop.background picture-uri file:////tmp/wallpaper.jpg bob@adminbaby:~/Desktop$ pwd /home/bob/Desktop bob@adminbaby:~/Desktop$ ls first bob@adminbaby:~/Desktop$ sudo gsettings set org.gnome.desktop.background picture-uri file:////tmp/wallpaper.jpg [sudo] password for bob:

(process:2230): dconf-WARNING **: 16:39:33.016: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory) bob@adminbaby:~/Desktop$ gsettings set org.gnome.desktop.background picture-uri file://// ~/Downloads/wallpaper.jpg Usage: gsettings [--schemadir SCHEMADIR] set SCHEMA[:PATH] KEY VALUE

Set the value of KEY to VALUE

Arguments: SCHEMADIR A directory to search for additional schemas SCHEMA The name of the schema PATH The path, for relocatable schemas KEY The key within the schema VALUE The value to set

bob@adminbaby:~/Desktop$ sudo gsettings set org.gnome.desktop.background picture-uri file:////home/bob/Downloads.jpg

(process:2240): dconf-WARNING **: 16:40:57.446: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory) bob@adminbaby:~/Desktop$ gsettings set org.gnome.desktop.background picture-uri file:////home/bob/Downloads/wallpaper.jpg bob@adminbaby:~/Desktop$ sudo gsettings set org.gnome.desktop.background picture-uri file:////tmp/wallpaper.jpg bob@adminbaby:~/Desktop$ wmctrl -m Command 'wmctrl' not found, but can be installed with: sudo apt install wmctrl bob@adminbaby:~/Desktop$ sudo apt install wmctrl Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: wmctrl 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 20.6 kB of archives. After this operation, 63.5 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu lunar/universe amd64 wmctrl amd64 1.07-7ubuntu1 [20.6 kB] Fetched 20.6 kB in 0s (62.8 kB/s) Selecting previously unselected package wmctrl. (Reading database ... 203962 files and directories currently installed.) Preparing to unpack .../wmctrl_1.07-7ubuntu1_amd64.deb ... Unpacking wmctrl (1.07-7ubuntu1) ... Setting up wmctrl (1.07-7ubuntu1) ... Processing triggers for man-db (2.11.2-1) ... bob@adminbaby:~/Desktop$ wmctrl -m Name: GNOME Shell Class: N/A PID: N/A Window manager's "showing the desktop" mode: OFF bob@adminbaby:~/Desktop$ realpath -s wallpaper.jpg /home/bob/Desktop/wallpaper.jpg bob@adminbaby:~/Desktop$ sudo gsettings set org.gnome.desktop.background picture-uri file://///home/bob/Desktop/wallpaper.jpg

(process:2829): dconf-WARNING **: 16:53:30.948: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory) bob@adminbaby:~/Desktop$ gsettings set org.gnome.desktop.background picture-uri file:///home/bob/Downloads/wallpaper.jpg bob@adminbaby:~/Desktop$

bob@adminbaby:~/Desktop$ realpath -s wallpaper.jpg /home/bob/Desktop/wallpaper.jpg bob@adminbaby:~/Desktop$ sudo gsettings set org.gnome.desktop.background picture-uri file://///home/bob/Desktop/wallpaper.jpg (process:2829): dconf-WARNING **: 16:53:30.948: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory) bob@adminbaby:~/Desktop$

sotirov
  • 4,379

1 Answers1

1

You used correct commands to change the wallpaper. Except you need not use sudo with gsettings command. The following commands will download and change desktop background.

wget -O ~/Downloads/wallpaper.jpg  "https://raw.githubusercontent.com/hoppersroppers/hoppersroppers.github.io/main/_layouts/constitution.jpg"

gsettings set org.gnome.desktop.background picture-uri file:///$HOME/Downloads/wallpaper.jpg # $HOME will expand to /home/bob

Similar issue was discussed here The gsettings command line tool doesn't change the background.

davidt930
  • 197
  • 5