Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-05-27 12:06:44

numzob
Member
Registered: 2014-08-04
Posts: 42

command line wallpaper-setter, again

I would like to set the xfce wallpaper from the command line.

I used to be able to do this using this line in my script:

  xfconf-query -c xfce4-desktop \
  -p /backdrop/screen0/monitor0/image-path \
  -s "$1"

where "$1" was the file name of the picture to use.

At some point that stopped working and after much googling, I ended up with this

  xfconf-query -c xfce4-desktop \
  -p /backdrop/screen0/monitoreDP1/workspace0/last-image \
  -s "$1"

I recently upgraded my Linux and naturally, the command above broke.  Can't set the wallpaper from the command line.

Googling again reveals other people having similar problems ... in 2013.  It also reveals this thread: http://forum.xfce.org/viewtopic.php?id=10836

The methods outlined in that thread no longer work.

So my wallpaper-setter script fails in xfce.  Can I have a clue?  What is the syntax this year?

Bonus: I would live to avoid using xfconf-query, as I prefer programs that have syntax consistency over time.

Thank you in advance.

Offline

#2 2016-05-27 12:50:43

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: command line wallpaper-setter, again

numzob wrote:

I would like to set the xfce wallpaper from the command line.

I used to be able to do this using this line in my script:

  xfconf-query -c xfce4-desktop \
  -p /backdrop/screen0/monitor0/image-path \
  -s "$1"

where "$1" was the file name of the picture to use.

This was probably for xfdesktop version <4.11.

At some point that stopped working and after much googling, I ended up with this

  xfconf-query -c xfce4-desktop \
  -p /backdrop/screen0/monitoreDP1/workspace0/last-image \
  -s "$1"

Post 4.11, there were some changes in xfce4-desktop that changed the layout of the xfconf tree (to allow for wallpaper per workspace functionality - hence the requirement for workspace in the xfconf path).

I recently upgraded my Linux and naturally, the command above broke.  Can't set the wallpaper from the command line.

Which version of xfdesktop are you running now? Which distro?

Googling again reveals other people having similar problems ... in 2013.  It also reveals this thread: http://forum.xfce.org/viewtopic.php?id=10836

The methods outlined in that thread no longer work.

That thread is related to xfwm4 settings through xfconf.

So my wallpaper-setter script fails in xfce.  Can I have a clue?  What is the syntax this year?

To determine the correct location of the backdrop entry, run:

xfconf-query -c xfce4-desktop -m

...and then change the wallpaper using the normal desktop dialog (or thunar's "set as wallpaper"). This will show you which xfconf setting was changed to display the image. Adjust your script to use this location.

Bonus: I would live to avoid using xfconf-query, as I prefer programs that have syntax consistency over time.

Unfortunately I am unaware of a non-xfconf-query option to set the wallpaper. Both thunar and ristretto programmatically use the xfconf libraries to set the wallpaper. I have noticed that changing video drivers changes the "monitor" name in the xfconf path - but that monitor name is obtained directly from X, so X is changing the name based on the driver.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-06-03 23:21:57

numzob
Member
Registered: 2014-08-04
Posts: 42

Re: command line wallpaper-setter, again

ToZ wrote:

Which version of xfdesktop are you running now? Which distro?

"xfdesktop --version" has me at xfdesktop version 4.12.3, running on Xfce 4.12.
Built with GTK+ 2.24.28, linked with GTK+ 2.24.30.

Debian Stretch 64-bit

To determine the correct location of the backdrop entry, run:

xfconf-query -c xfce4-desktop -m

...and then change the wallpaper using the normal desktop dialog (or thunar's "set as wallpaper"). This will show you which xfconf setting was changed to display the image. Adjust your script to use this location.

Wow. That worked. I could have sworn I tried it before and it had no output. Today, it generated output.  Go figure.

So the section of my "setwall" script was modified based on that output:

  xfconf-query -c xfce4-desktop \
  -p /backdrop/screen0/monitor0/workspace0/last-image \
  -s "$1"

which now works.  smile

Thank you very much.

Last edited by numzob (2016-06-03 23:22:24)

Offline

Board footer

Powered by FluxBB