Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


Search this Thread
Old 10-27-2011, 08:21 PM   #1
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 7,914

Rep: Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493Reputation: 1493
Scripting Changing Backgrounds in Fluxbox

This is based on a little script I found when I was playing with FVWM.

I have spent almost an hour looking for the original so I could give the actual author credit. If anyone knows the source, please post it.

This is the original.

It selects a random background from the designated directory and changes it every 30 minutes.


while true; do
	find ~/wallpapers -type f \( -name '*.jpg' -o -name '*.png' \) -print0 |
		shuf -n1 -z | xargs -0 feh --bg-fill
	sleep 30m
It was designed to be inserted in an .xinitrc file as /path/to/ & (the "&" keeps it running for the duration of the session) and called before exec fvwm. I suspect it could work with almost any window manager when called from .xinitrc.

I tested it today with Fluxbox's fbsetbg command and it works just fine when called from the Fluxbox startup file as /path/to/ &. As you see, all I did was substitute an fbsetbg command for the feh command. Because fbsetbg already has a "random" argument, I was able to discard all the "find" stuff.

If you have Fluxbox installed, see the fbsetbg help (fbsetbg -h) for an explanation of the switches.


while true; do
        fbsetbg -f -R ~/wallpapers
        sleep 30m
I really enjoy watching all the beautiful wallpapers I've collected go by (I favor landscape scenery). I thought others might have fun with it.

Last edited by frankbell; 10-27-2011 at 08:22 PM. Reason: grammar


backgrounds, fbsetbg, fluxbox, wallpaper

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
fluxbox backgrounds in -current bl0tt0 Slackware 6 06-21-2006 04:39 PM
backgrounds in fluxbox Smokey Slackware 2 08-30-2004 10:13 PM
Changing backgrounds with fluxbox Protex Slackware 2 07-12-2004 11:29 AM
Changing backgrounds on fluxbox? Zaskar Debian 5 03-06-2004 01:40 AM
Fluxbox Backgrounds chhiperic Linux - Newbie 5 05-08-2003 08:07 PM

All times are GMT -5. The time now is 12:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration