In Plasma 5, I could get the current wallpaper from the file ~/.config/plasma-org.kde.plasma.desktop-appletsrc, but that file seems to be gone in Plasma 6. Is there a way to get the filename of the current wallpaper in 6? I have scripts that provide info on demand for the random wallpapers that come up, but in 6 I have to right click and “Open wallpaper image” to get the filename. How can I do that programmatically?
i just did a search in ~/.config
for the name of the file used in my wallpaper settings and found it mentioned in
plasmarc
and
plasma-org.kde.plasma.desktop-appletsrc
Coincidentally, I have an alias for it on my .bash_aliases:
alias wid='cat ~/.config/plasmarc | grep -i wallp | cut -d "/" -f 2-6'
Thanks for the info. What I have in plasmarc is 2 lines:
[Theme]
name=air
What I have in plasma-org.kde.plasma.desktop-appletsrc for wallpapers is a list of directories used for the slideshow, no mention of the current image’s filename. A recursive grep on all files in .config yielded no results for the current filename. Are you using the slideshow?
More info: in plasma-org.kde.plasma.desktop-appletsrc under
[Containments][1][Wallpaper][org.kde.slideshow][General]
I find (not literally):
Image=file:///path_to_wallpaper.jpg
However, that filename does not change until I log out, at which time it updates to the wallpaper that was showing when I logged out. When I log back in, it does not change, no matter how many times the wallpaper changes, until I log out. It seems to be persistent storage of the image filename saved only on logout. I have found nothing, so far, that is updated when the images changes.
Dbus?
Found it: here’s the dbus command to return the current wallpaper filename:
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.wallpaper 0 | grep ‘Image: file:’ | cut -c 15-
Without piping the qdbus output to grep and cut, there are a set of parameters associated with the slideshow plugin, such as directories, time between changes, etc.
Thanks for the tip. I had to change my alias to your command line.