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.

5 Answers 5


The are 2 possible locations:

For the user check


Globally check the system wide path


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, 2014 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, 2014 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, 2014 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, 2014 at 21:26

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)
# 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.

  • 2
    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, 2018 at 20:37

I know this is an old question, but recently I tried figuring this myself. This is my solution:

Create a file named screenLocker inside /usr/bin/

Put the following inside (replace YOUR_CURRENT_THEME with your theme):

ln -fs $(xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image) \ 
/usr/share/slim/themes/YOUR_CURRENT_THEME/background.png && slimlock


sudo chmod +x /usr/bin/screenLocker

and add/edit keyboard shortcut to use command /usr/bin/screenLocker

Now every time you change desktop wallpaper your lock screen will match.


This will list all the backgrounds

xfconf-query -c xfce4-desktop -l | grep last-image

then use the above output to get the path of the wallpaper.

for eg:

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorVNC-0/workspace0/last-image
  • 1
    Combined into a single command: xfconf-query -c xfce4-desktop -l | grep last-image | xargs -n1 -- xfconf-query -c xfce4-desktop -p Dec 5, 2020 at 11:06
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, 2018 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.