HOW TO read current XFCE wallpaper or background file name [SOLVED]

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
spamhog
Level 3
Level 3
Posts: 146
Joined: Thu Dec 17, 2009 6:21 pm
Contact:

HOW TO read current XFCE wallpaper or background file name [SOLVED]

Post by spamhog »

Why?
- a cool wallpaper shown by e.g. random changer isn't easy identified (mine come from a ~5k image dump, the GUI desktop settings preview window takes ages to fill)
- setting location in the tree changed over time
- so past magic formulas become wrong.

BE EXTRA CAREFUL WITH XFCONF AS IT MAY CHANGE SETTINGS

As of April 2021, Mint 20.1 XFCE, you find it like so:

Code: Select all

xfconf-query -c xfce4-desktop -lv | grep "last-image"
As a .desktop button, save e.g. as current-background.desktop :

Code: Select all

[Desktop Entry]
Version=1.0
Type=Application
Name=CURRENT BG
Comment=:-D
Exec=xfce4-terminal -e 'bash -c "xfconf-query -c xfce4-desktop -lv | grep "last-image"; bash"'
Icon=
Path=
Terminal=false
StartupNotify=false
Explanation:
- it's in the xfce4-desktop channel
- grepping "last-image" shows all wallpapers for all vitual desktops.

In the future path may change, so update by going to Menu - Settings - Setting Manager, don't change anything there, nose or search around, make a note of channel and some identifying string. :D
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Xfce”