5

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
Alex Stragies
  • 5,857
  • 2
  • 32
  • 56
Machine Yadav
  • 149
  • 1
  • 3
  • 13

3 Answers3

7

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.

  • I will try soon – Machine Yadav Jul 01 '20 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 – Machine Yadav Jul 02 '20 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 Feb 01 '23 at 08: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.

user419050
  • 339
  • 3
  • 11
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.

AdminBee
  • 21,637
  • 21
  • 47
  • 71