phunni Posted February 21, 2003 Report Share Posted February 21, 2003 I use fluxbox as my window manager and have written a script called autostart.sh which gets run when fluxbox is started. I tried to use a package that was supposed to randomly set my background based on images in a given directory - this didn't work so I wrote a simple Java class to do the same. I then wrote a simple shell script to run it and added this to autostart.sh as something to run when fluxbox is started. Nothing happens. If, however, I run my script in a konsole - all works beautifully. What's going on here? My script is as follows export CLASSPATH=$CLASSPATH:~/.fluxbox java BackgroundChanger ~/.fluxbox/backgrounds Quote Link to comment Share on other sites More sharing options...
aru Posted February 21, 2003 Report Share Posted February 21, 2003 I don't know anything about java, but if you want a simple shell script to randomly display an image in the fluxbox background, here you are: #! /bin/bash # wallpaperRandom wallpaper_cmd="/usr/X11R6/bin/wmsetbg -s " images_dir="${HOME}/xresources/backgrounds/" images_filter="*.jpg" images_list=($(/bin/ls ${images_dir}/${images_filter})) image=${images_list[$((${RANDOM}%${#images_list[@]}))]} exec ${wallpaper_cmd} ${image} & The code is extracted from a dedicated function coded in my own fluxboxrc (the equivalent to your autostart.sh); If you are interested I can post it here. To use the 'wallpaperRandom' script just make it executable and call it from your autostart.sh HTH Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.