Subject: FVWM: random background picture

From: Eric Coulthard <[email-masked]>
Date: Wed, 15 Dec 2004 18:14:09 -0700 (MST)

Hello I have been experimenting with using a random background image and I
found a command that will do it. Unfortunatly it doesn't work in my
.fvwm2rc file. I was wondering if you could offer any helpful suggestions.
This is the command as it is used in my InitFunction:

+	"I" exec xv -root -max -quit bgpictures/bg$[RANDOM % 3 +1].jpg

Now it is supposed to pick between 3 jpg files each named bg1.jpg bg2.jpg
and bg3.jpg in the bgpictures directory. It works if I use this command in
my .bashrc file but not the .fvwm2rc file. I am certain it is because
fvwm doesn't recognize the $[RANDOM % 3 + 1] part but I would like to
know if their is a way I can get it to recognize it. If anyone can help me
that would be great.

Eric Coulthard
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Wed, 15 Dec 2004 21:01:18 -0500

> know if their is a way I can get it to recognize it. If anyone can help me

You can use:

ExecUseShell /bin/bash

or

+ "I" exec bash -c 'xv -root -max -quit bgpictures/bg$[RANDOM % 3 +1].jpg'

But I predict 3 pictures won't be enough.
I started with 1 and a few years later I have 1056.

-- 
Dan Espen                           E-mail: [email-masked]

---

From: Hannes Klas <[email-masked]>
Date: Thu, 16 Dec 2004 22:46:27 +0100

> know if their is a way I can get it to recognize it. If anyone can help me
In the FvwmWiki, you can find a Lisp-Script that picks a random Image
out of a Directory with Images. If the Wiki is not available right
now, i could attach it

> Eric Coulthard
Hannes Klas

---

From: Vincent Bernat <[email-masked]>
Date: Fri, 17 Dec 2004 09:52:31 +0100

OoO  En cette  soirée bien amorcée   du jeudi 16  décembre  2004, vers

> out of a Directory with Images. If the Wiki is not available right

I use this snippet of code which uses python :

python -c "import glob, random, os ; os.system('Esetroot -scale %s' % random.choice(glob.glob('*.jpg')))"
-- 
panic("Unable to find empty mailbox for aha1542.\n");
	2.2.16 /usr/src/linux/drivers/scsi/aha1542.c