LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

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

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
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.

Code:
#!/bin/sh

while true; do
	find ~/wallpapers -type f \( -name '*.jpg' -o -name '*.png' \) -print0 |
		shuf -n1 -z | xargs -0 feh --bg-fill
	sleep 30m
done
It was designed to be inserted in an .xinitrc file as /path/to/foo.sh & (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/foo.sh &. 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.

Code:
#!/bin/sh

while true; do
        fbsetbg -f -R ~/wallpapers
        sleep 30m
done
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
 
  


Reply

Tags
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 10:27 PM.

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