2

Does anyone know where the current wallpaper is stored in xfce4?

I am using SLiM and I want to symlink the SLiM background to whatever my current wallpaper is so I don't have to manually change it every time.

3

The are 2 possible locations:

For the user check

~/.local/share/xfce4/backdrops/

Globally check the system wide path

/usr/share/xfce4/backdrops

To share a wallpaper between SLiM and your desktop, rename the used theme background, then create a link from your desktop wallpaper file to the default SLiM theme:

mv /usr/share/slim/themes/default/background.jpg{,.bck}
ln -s /path/to/mywallpaper.jpg /usr/share/slim/themes/default/background.jpg
  • I've found those, but that's only the directory where XFCE populates the backgrounds list under desktop settings. I want to know where I can find the currently set background so I can create a symlink to that specific file. – user66330 May 21 '14 at 19:53
  • Have you tried to look also into /usr/share/backgrounds/xfce/? This wallpaper is a personal loaded image or is from the XFCE install? – cioby23 May 21 '14 at 21:09
  • A personal image. I want a way to change my xfce wallpaper and have SLiM automatically change with it. I used to have the background.png in my SLiM theme symlinked to ~/.background.png before I started using xfce. I would like to acheive the same result. – user66330 May 21 '14 at 21:21
  • Well in that case if you know the image name you can search for it and them follow the procedure in the updated aswer. – cioby23 May 21 '14 at 21:26
1

Although this is an old question as a recent convert to arch and xfce4 I have also been puzzling over this issue. I finally found a solution and thought I'd post it here in case it's of use to others. e.g.

#!/bin/bash -
#
# define xfce4 xml file that holds info about desktops 
# 
DESKTOP="/home/$(id -un)/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml"
#
# define xpath that will extract current desktop background file name
# (NB I am no expert in xpaths and there is probably a much more elegant way
#  to do this but this works for me)
#
XPATH='(//property[@name="workspace0"]/property[@name="last-image"])[last()]/@value'
#
# use xmllint utility to apply xpath to file and extract file path and name
#
IMAGE=$(xmllint --xpath "string(${XPATH})" "${DESKTOP}")
#
# display the file info extracted
#
echo Current Wallpaper File = ${IMAGE}
#
# rest of script........
#

xmllint is provided by the libxml2 package.

  • 1
    actually, for multiple monitor config, xfconf-query -c xfce4-desktop -p /backdrop/screen0/$(xrandr|awk '/\<connected/{print "monitor"$1}')/workspace0/last-image – eMPee584 Feb 2 '18 at 20:37
-1
xfconf-query -c xfce4-desktop -p /backdrop/screen0/$(xrandr|awk '/\<connected/{print "monitor"$1}')/workspace0/last-image

This will fetch the connected monitor name from xrandr, then get the wallpaper setting for it.

What a waste of time finding this out 🤣

  • Doesn't work for me: my monitor is DVI-I-1, but the background is stored under /backdrop/screen0/monitorDVI-0/workspace0/last-image (I think; the entry for /backdrop/screen0/monitor0/workspace0/last-image appears to be stale). – Mark Feb 2 '18 at 23:32

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.