Fluxbox auto changing background


Forum: Programming and Scripting
Topic: Fluxbox auto changing background
started by: Shades

Posted by Shades on Dec. 12 2005,06:09
I'm wondering if anyone would happen to know the code I can put in my fluxbox init file to tell it to change the wallpaper after a certain amount of time? I've got several different backgrounds I want to display and thought it would be cool to rotate them after a time.

:cool:

Posted by mikshaw on Dec. 12 2005,16:40
There's a script here that will set a random background from a given directory:
< http://damnsmalllinux.org/cgi-bin....;t=2456 >

I've never done anything related to rotation, so couldn't tell you how to accomplish that.  It could be as simple as putting the main block of code within a function and having it triggered by a loop and a sleep command.

Posted by Shades on Dec. 15 2005,07:13
Thanks Mikshaw...I used the link and the code you had on it. The only thing is I've never created anything like that and I'm not so sure where to start.  ???

I pasted it in Beaver and saved it as a .sh file. I placed it in the backgrounds folder but wasn't sure how to reference it in the init file.

:cool:

Posted by mikshaw on Dec. 15 2005,16:00
That script was written mainly to pick a random background only once, when fluxbox is started.  It's meant to be run from .fluxbox/init
Code Sample
session.screen0.rootCommand: sh  /path/to/script

If you make the script executable (chmod +x /path/to/script) you can leave out the "sh".

Note libretto's comment: "Took out the star (*) in the bg_pics line adn [sic] the code works".  I think i was testing it with gnu find.

In its current state it will not do a slideshow...it runs once and quits. This is not a task that really interests me, so i haven't done any more work or research on it.
A simple solution may be to set up a hotkey combo in fluxbox linked to the script...any time you want a new background just hit the appropriate keys.

Posted by SaidinUnleashed on Dec. 15 2005,18:51
This is more of a programming/scripting topic.

Moved~
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.