You are not logged in.
Pages: 1
Hi all, i have a question: is there someway to get the current backdrop path from the backdrops list?
is it stored in some file or something?
my objective is to make a simple backdrops laucher, the randomizing part is done by xfdesktop -reload, i'm missing the remove current backdrop from list and for that i need to get the current backdrop path, any ideias?
thanks in advance
Offline
This is impossible for Xfce 4.0 en 4.2 AFAIK. I do not know whether this changed for 4.4
Offline
xfdesktop can't do this, but bash can.
And I happen to be bored enough to wright the script. ;D
It read the wallpaper from a file, links it to "~/.config/xfce4/deskimg", removes the wallpaper from the list and reloads xfdesktop.
#!/bin/bash
FILES=`head -n 1 ~/.config/xfce4/deskfiles | awk -F"files=" {'print $2'}`
RAND=$((RANDOM%$FILES+1))
IMGLINE="$(($RAND+1))p"
LINK=`sed -n $IMGLINE ~/.config/xfce4/deskfiles`rm ~/.config/xfce4/deskimg
link $LINK ~/.config/xfce4/deskimgFILES_NEW=$(($FILES-1))
sed -i -e "s/files\=$FILES/files\=$FILES_NEW/g" ~/.config/xfce4/deskfiles
DELLINE="$(($RAND+1))d"
sed -i -e $DELLINE ~/.config/xfce4/deskfilesxfdesktop --reload
You will need to make a file with all your wallpapers in call "~/.config/xfce4/deskfiles" it should look like this
files=3
/path/to/wallpaper1.png
~/path/to/wallpaper2.png
/path/to/wallpaper3.jpg
you can have as many wallpapers as you like just make sure that "file=" has the right number or it will not display all the wallpapers.
xfdesktop will need to be pointed at ~/.config/xfce4/deskimg
Offline
thanks, that is an approach, should have thought of making the bash aproach also
again many thanks
Offline
thanks, that is an approach, should have thought of making the bash aproach also
again many thanks
I've updated it a bit now you can use any backdrop.list made with xfdesktop, but you still need to use ~/.config/xfce4/deskimg as the image file.
#!/bin/bash
#change this to any list made with xfdesktop
LIST=~/.config/xfce4/desktop/backdrops.list
FILES=`grep -c "/" $LIST`
RAND=$((RANDOM%$FILES+1))
IMGLINE="$(($RAND+1))p"
LINK=`sed -n $IMGLINE $LIST`
rm ~/.config/xfce4/deskimg
link $LINK ~/.config/xfce4/deskimg
FILES_NEW=$(($FILES-1))
sed -i -e "s/files\=$FILES/files\=$FILES_NEW/g" $LIST
DELLINE="$(($RAND+1))d"
sed -i -e $DELLINE $LIST
xfdesktop --reload
Offline
Pages: 1
[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 531.7 KiB (Peak: 532.33 KiB) ]