You are not logged in.
Pages: 1
Is there a way to open the current wallpaper that the xfdesktop chose randomly? Or at least get the path to the file?
Offline
Most are in /usr/share/backgrounds or /usr/share/wallpapers.
But it's all right, when you're all in pain and you feel the rain come down
It's alright, when you find your way, then you see it disappear
It's alright....
Chris Cornell
Offline
Run this in terminal
xfconf-query -c xfce4-desktop -m...and then change the background using the Settings Manager > Desktop.
The command monitors channel xfce4-desktop for changes.
It will tell which property on channel xfce4-desktop is changed.
Then you can check that property to list the current background
xfconf-query -c xfce4-desktop -p insert_property_hereNow opening with ristretto
ristretto "$(xfconf-query -c xfce4-desktop -p insert_property_here)"Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c
Offline
Found a better solution. The code above doesn't open the original file. I have a lot of wallpapers that i downloaded in bulk from the internet but didn't have the time to handpick them so i delete the ones that i don't like as they come. So i needed a option that opened the original file so i could delete or make copies of what i liked. I managed to make it work by using Thunar's custom actions:
Open Wallpaper
Command: bash ~/.config/openbox/wallchange/open-wallpaper.sh
Next Wallpaper
Command: bash ~/.config/openbox/wallchange/wallchange-xfce.sh
wallchange-xfce.sh
#!/bin/bash
WPCURRENT="$(find ~/Pictures/Wallpapers/ -type f |shuf -n1)" #gets a random image
echo -n ${WPCURRENT} > ~/.config/openbox/wallchange/wallpaper-history.txt #prints chosen image to txt file
xfconf-query --channel xfce4-desktop --property /backdrop/screen0/monitorVGA1/workspace0/last-image --set $WPCURRENT #sets the wallpaper
cat ~/.config/openbox/wallchange/wallpaper-history.txt #prints it to consoleopen-wallpaper.sh
#!/bin/sh
IMG=$(cat ~/.config/openbox/wallchange/wallpaper-history.txt | awk -F "'|/" '{print $0}')
xviewer "${IMG}" &
exitProblem is that sometimes i get a blank screen even if the output points to a image. Any idea why this happens?
Offline
Nevermind. $WPCURRENT needs to be "$WPCURRENT" otherwise images that have spaces on their name cause the issue.
Offline
Pages: 1
[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 530.99 KiB (Peak: 531.97 KiB) ]