Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-07-10 12:10:06

paolo321
Member
Registered: 2011-06-26
Posts: 121

[Solved] backdrop image list ?

Hi, I'm using xfce 4.8 on opensuse 11.4 in virtualbox

I'd like to have a simple wallpaper changer, so I loaded a bunch of images in an "Image List", and selected "Image List"
It works, and xfdesktop --reload changes the image.

But when I login, immediately after the splash screen, I see 3-4 wallpapers changing rapidly (very rapidly, only see them for a fraction of second).
Then I see a "definitive" background...

This is not nice to see, seems something related to the startup phase, but I have not found a way to fix it.

Any idea?
Thank you

Offline

#2 2011-07-10 14:20:30

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: [Solved] backdrop image list ?

Tried another way:
creating an image list named .bdrotate.list , but this seems not always working (sometimes xfdesktop doesn't reload the new wallpaper)

#!/bin/bash
LIST="/usr/share/wallpapers/ $HOME/Pictures/"
echo "# xfce backdrop list" > .bdrotate.list
find $LIST -type f -name '*.jpg' | shuf -n 1 >> .bdrotate.list
xfdesktop --reload

BUT this seems to work, without anything else:

#!/bin/bash
LIST="/usr/share/wallpapers/ $HOME/Pictures/"
BG=$(find $LIST -type f -name '*.jpg' | shuf -n 1)
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s $BG

Offline

#3 2011-07-10 16:22:30

Pindakoe
Member
From: NL
Registered: 2003-11-26
Posts: 116

Re: [Solved] backdrop image list ?

Are you changing this by means on a scrip? Description sounds a bit like multiple instances being started (probably because session was saved with one running; when restarting it upon next logon xfce's session manager will restart the script plus possibly start another one depending how you coded that.

I also note that the call to 'shuf' to randomise the list is not really needed; xfdesktop will (at least in 4.6 and previous) automatically select a random wallpaper.

My own script to show a random wallpaper every 15 minutes:

#!/bin/bash
# Wall paper changer for Xfce 4.6

MONITOR=${1:-0}
export DISPLAY=":0.0"
PROPERTY="/backdrop/screen0/monitor${MONITOR}/image-path"
IMAGE_PATH=`xfconf-query -c xfce4-desktop -p ${PROPERTY}`    # list with wallpapers
echo "# xfce backdrop list" > $IMAGE_PATH            # Mandatory header for xfce backdrop lists
find ~/wallpapers/ -type f >> $IMAGE_PATH            # Populate list with all images
while [ 1 ]; do
  xfconf-query -c xfce4-desktop -p ${PROPERTY} -s ""    # Zero list
  # Re-set list, thus select random wallpaper
  xfconf-query -c xfce4-desktop -p ${PROPERTY} -s "${IMAGE_PATH}"
  sleep 15m                            # Will start with new wallpaper anyway
done

Moving the echo and find commands in the while loop makes it possible to scan  your wall paper directories every time. In my case not really needed as I have >1300 wallpapers and waiting uintil next logon for it being picked up is good enough.

Offline

#4 2011-07-12 14:09:47

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: [Solved] backdrop image list ?

You're right , problem was related to sessions: don't know exactly why, but deleting .cache/sessions everything seems to works, Image List doesn't flicker anymore...
I'm just testing xfce in a vm, probably I've messed up something ...

btw, my script uses shuf since it selects a single image, and not an image list.

EDIT:
if someone is interested, sample script I posted above has problems if path has whitespaces... Something like this seems to work better:

IMGDIRLIST[0]="/usr/share/wallpapers/"
IMGDIRLIST[1]="$HOME/My Pictures/" #Path with whitespaces works like this
IMGDIRLIST[2]=~/"My Pictures/" #Another example, ~ needs to be unquoted
IMGDIRLIST[3]="$HOME/Wallpapers/"

BG="$(find "${IMGDIRLIST[@]}" -type f -name '*.jpg' | shuf -n 1)"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "$BG"

EDIT: marking as solved...

Last edited by paolo321 (2011-07-12 21:21:08)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 528.95 KiB (Peak: 529.57 KiB) ]