7

Linux kali-linux 5.6.0-kali2-amd64 #1 SMP Debian 5.6.14-2kali1 (2020-06-10) x86_64 GNU/Linux

I want to change my wallpaper from the terminal.

I tried methods suggested here and:

  • Gsettings doesn't work :
    gsettings set org.cinnamon.desktop.background picture-uri "file:///filename" doesn't work.
  • I can't install xsetbg by apt install xsetbg
  • feh method doesn't give output or change wallpaper.
  • Even Gsettings for gnome doesn't work:
    gsettings set org.gnome.desktop.background picture-uri file:///path/to/your/image.png

5 Answers 5

8

Xfce uses the Xfconf configuration system. To access the xfconf there is a CLI tool xfconf-query. https://docs.xfce.org/xfce/xfconf/xfconf-query

To find out what property is changed when the backgound changes, run the following command in a terminal window:

xfconf-query -c xfce4-desktop -m

...and then change the background using the Settings Manager > Desktop.

The command monitors channel xfce4-desktop for changes. It will tell which property on channel xfce4-desktop is changed.

Then the command to change that property would be like this

 xfconf-query -c xfce4-desktop -p insert_property_here -s path/image

Change propery and path to image accordingly.

3
  • I will try soon Commented Jul 1, 2020 at 14:48
  • 1
    xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorLVDS-1/workspace0/last-image -s /usr/share/plasma/look-and-feel/Kali-Light/contents/previews/fullscreenpreview.jpg Works Commented Jul 2, 2020 at 17:06
  • Note to self: only now I realized that the right-button menu on the XFCE4 desktop has a "Next Background" entry which does what is on the label. Not sure if this helps the OP as it is not clear whether "change" means "set specific file" or whether "advance to next in the list of possible backgrounds" would be sufficient.
    – Harald
    Commented Feb 1, 2023 at 8:09
2

I have a solution which uses xwallpaper. You should be able to install it with sudo apt install xwallpaper.

You can use command bellow to set your wallpaper*

xwallpaper --zoom path/to/your/wallpaper.jpg

(The image doesn't have to be a .jpg)

*Keep in mind that this is not permanent, you could add the same line to your .xprofile in your home folder ("~") to make it permanent.

2
  • 1
    Something is better than nothing Commented Jul 1, 2020 at 12:22
  • Didnt work, didnt gave any output the wallpaper is same Commented Jul 1, 2020 at 12:54
0

The command

xfdesktop --next

jumps to the next background image in the list. It can be bound to a keystroke in the Keyboard / Application Shortcuts panel. Here, man xfdesktop gave me that answer.

1
0

Miloš' answer got me there, but found a more convenient way than monitoring for settings changes that works for me:

xfconf-query -c xfce4-desktop -p $(xfconf-query -c xfce4-desktop -l | grep "workspace0/last-image") -s /path/to/wallpaper
0

When for some reason multiple desktops are registered, the following command can be used to change them all at once by using xargs, modified from itsonlymire's answer.

xfconf-query --channel xfce4-desktop --list | grep last-image | xargs xfconf-query -c xfce4-desktop -s /path/to/wallpaper -p

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .