LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-30-2011, 08:13 PM   #1
michijo
Member
 
Registered: Apr 2011
Posts: 162

Rep: Reputation: 0
rotating background image script


has this been covered anywhere: rotating background image script? I want to rotate Pieter Bruegel the Elder paintings of peasants! But I use Xmonad as my window manager. Interested in script that doesn't need Gconf.

I am going to try to write one. I have: a command is repeated on a timer, such as here:

http://www.unix.com/shell-programmin...t-command.html

The command is a command to select a wallpaper.

wmsetbg -t ~/backgrounds/massacre.jpg

"wmsetbg" does not have an option to select a random wallpaper. Does anyone know a way to get a random wallpaper set?

Thanks!
 
Old 11-30-2011, 08:19 PM   #2
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
If you have fluxbox installed you can use fbsetbg, which has the -r option for setting a random wallpaper from a specified directory.
 
Old 11-30-2011, 10:05 PM   #3
michijo
Member
 
Registered: Apr 2011
Posts: 162

Original Poster
Rep: Reputation: 0
it worked!

Okay thanks for that tip. It works now and is switching well!

Code:
#!/bin/bash

while :
 
 do

   fbsetbg -t -r /home/michijo/backgrounds 

   sleep 30

 done
 
Old 12-01-2011, 05:58 AM   #4
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 598
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
I use the following to randomly set backgrounds on log in, or added to crontab to run every 2 hours
Code:
#!/bin/bash
export DISPLAY=:0.0
WALLPAPERS="/home/neil/Pictures/wallpapers/"
ALIST=( `ls -w1 /home/neil/Pictures/wallpapers` )
RANGE=${#ALIST[@]}
let "number = $RANDOM"
let LASTNUM="`cat $WALLPAPERS/.last` + $number"
let "number = $LASTNUM % $RANGE"
echo $number > $WALLPAPERS/.last

feh --bg-scale $WALLPAPERS/${ALIST[$number]}
Pinched the script from the Debian openbox wiki
 
Old 12-01-2011, 11:46 PM   #5
michijo
Member
 
Registered: Apr 2011
Posts: 162

Original Poster
Rep: Reputation: 0
Wink scripts

The script I made does just the thing though: it rotates slowly through Bruegel paintings. This is a fantastic way to view artwork on the sly, by presaving paintings I like then adding them to the gallery. Already since doing this, I have been analyzing Bruegel paintings and noticing little minute details I never noticed before.
 
  


Reply


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
LXer: Rotating you Gnome 3 Background images LXer Syndicated Linux News 0 08-08-2011 06:30 AM
[SOLVED] rotating an image in GIMP newbiesforever Linux - Software 6 08-01-2011 08:24 PM
Logrotate/ bash script not rotating file noir911 Linux - Server 2 01-15-2009 03:56 PM
simple script to grab an image from a web page and set background stardotstar Programming 43 09-11-2006 10:52 PM
adding a rotating - to my bash script Cinematography Programming 3 08-31-2005 01:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration