View previous topic :: View next topic |
Author |
Message |
elboricua Apprentice
Joined: 17 May 2002 Posts: 226 Location: Bronx, NY
|
Posted: Tue Oct 22, 2002 1:54 am Post subject: Fluxbox Background Image Menu Option Question |
|
|
Hello all,
I just upgraded my fluxbox to the newest one available in the portage tree
0.1.12-r1
I noticed that there is now an entry in the menu
Box==>Settings==>Backfround Image. When checking the menu script that it points to it looks like it should be getting the list of files from /usr/share/commonbox/backgrounds
There is a file there gentoo.jpg but it does not show up in the list to be able to change to. Does anyone know what has to be done to get this working? The list is empty. The menuoption looks like this by default /usr/share/commonbox/imagebgmenu
Code: | [submenu] (background images) {choose image...}
[end] |
I would love it if I can get this working. Right now I normally just use Esetroot to choose my background. I have it set in the fluxbox startup script that I wrote myself. But if I want to change the background I have to manually edit that script and restart fluxbox. It would be awesome to have this work and have the ability to change backgournds on the fly. The set background color works, which too is awesome. TIA, _________________ Boricua Hasta La Muerte |
|
Back to top |
|
|
elboricua Apprentice
Joined: 17 May 2002 Posts: 226 Location: Bronx, NY
|
Posted: Tue Oct 22, 2002 1:58 am Post subject: |
|
|
NM everyone. Sorry I figured it out. I looked at the /usr/share/commonbox/solidbgmenu and saw that it has an entry for every color
Code: | [exec] (white) {bsetroot -solid "#ffffff"} |
I am guessing that I have to do the same for my wallpaper. Dats a lot of editing as I have a ton of wallpaper. _________________ Boricua Hasta La Muerte |
|
Back to top |
|
|
nmr_spectrometer n00b
Joined: 07 Oct 2002 Posts: 55
|
Posted: Tue Oct 22, 2002 12:57 pm Post subject: |
|
|
Here's a quickie bash script to help you out:
(run it from the directory containing your wallpapers)
Code: | #!/bin/bash
touch ~/newimagebgmenu
echo "[submenu]" >> ~/newimagebgmenu
for name in *
do
echo "[exec] ($name) {Esetroot -fit $PWD/$name}" >> ~/newimagebgmenu
done
echo "[end]" >> ~/newimagebgmenu |
Then copy newimagebgmenu to ~/.fluxbox, and add "[include] (~/.fluxbox/newimagebgmenu)" wherever you want it.
You might need to change the script if you don't have Esetroot emerged; fluxbox has "bsetbg" but it doesn't work correctly for me with its "fit to desktop" option (-f). I also believe that Esetroot does some filtering so scaling an 800x600 wallpaper to 1600x1200 doesn't look bad at all. On Esetroot:
-fit: will 1:1 scale the image
-scale: will stretch the image to fit the whole desktop |
|
Back to top |
|
|
elboricua Apprentice
Joined: 17 May 2002 Posts: 226 Location: Bronx, NY
|
Posted: Tue Oct 22, 2002 9:42 pm Post subject: |
|
|
Very cool Thank you. The lazy typest in me loves that script _________________ Boricua Hasta La Muerte |
|
Back to top |
|
|
TheEternalVortex Apprentice
Joined: 15 Oct 2002 Posts: 207 Location: San Jose, CA
|
Posted: Tue Oct 22, 2002 9:51 pm Post subject: |
|
|
/me likes the Gentoo background that comes by default |
|
Back to top |
|
|
TheEternalVortex Apprentice
Joined: 15 Oct 2002 Posts: 207 Location: San Jose, CA
|
Posted: Wed Oct 23, 2002 1:17 am Post subject: |
|
|
I changed the script a bit, adding an option to update, and using xv to set the background image.
Code: | #!/bin/bash
cd ~/wallpaper
touch ~/newimagebgmenu
echo "[submenu]" >> ~/newimagebgmenu
echo "[exec] (update...) {~/generatebgmenu.sh}" >> ~/newimagebgmenu
for name in *
do
echo "[exec] ($name) {xv -root -rmode 5 -max -quit $PWD/$name}" >> ~/newimagebgmenu
done
echo "[end]" >> ~/newimagebgmenu
mv ~/newimagebgmenu ~/.fluxbox/newimagebgmenu |
|
|
Back to top |
|
|
wimac n00b
Joined: 20 Jun 2002 Posts: 28 Location: st. louis, mo
|
Posted: Wed Oct 23, 2002 2:16 am Post subject: |
|
|
I use a little script that genterates a nice little file, then I add an entry into my menu file like this:
[include] (~/.fluxbox/bgMenu)
Code: |
#!/bin/bash
PIC_DIR=/home/wimac/backgrounds
SEARCH_PICS=/home/wimac/backgrounds
#
# background display type for Esetroot: -fill -scale -center -mirror
#ie, how you want pic dislplayed
ESETTYPE=-scale
BGMENU_PLACE=/home/wimac/.fluxbox
find $SEARCH_PICS -name '*.jpg';
find $SEARCH_PICS -name '*png';
find $SEARCH_PICS -name '*bmp';
rm $BGMENU_PLACE/bgMenu
rm $BGMENU_PLACE/bgMenu.tmo
echo -e "[submenu] (backgrounds)" >> $BGMENU_PLACE/bgMenu.tmo
for JPEG in $PIC_DIR/*.jpg
do
echo -e "[exec] ($JPEG) {Esetroot $ESETTYPE $JPEG}" >> $BGMENU_PLACE/bgMenu.tmo
done
for PNG in $PIC_DIR/*.png
do
echo -e "[exec] ($PNG) {Esetroot $ESETTYPE $PNG}" >> $BGMENU_PLACE/bgMenu.tmo
done
for BMP in $PIC_DIR/*.bmp
do
echo -e "[exec] ($BMP) {Esetroot $ESETTYPE $BMP}" >> $BGMENU_PLACE/bgMenu.tmo
done
echo -e "[end]" >> $BGMENU_PLACE/bgMenu.tmo
#this takes the directory part of the file name out of the menu
#after the first ( put the PIC_DIR, but put \ b4 each / in the dir name to delimitit it
# ie /home/war_pig/ becomes \/home\/war_pig\/
sed -e 's/(\/home\/wimac\/backgrounds\//(/g' $BGMENU_PLACE/bgMenu.tmo >> $BGMENU_PLACE/bgMenu
echo "done"
exit 0
|
hope that helps. _________________ -------------------
\/\/ | /\/\ /\ [
w i m a c
rm -rf /bin/laden |
|
Back to top |
|
|
nmr_spectrometer n00b
Joined: 07 Oct 2002 Posts: 55
|
Posted: Wed Oct 23, 2002 3:20 pm Post subject: |
|
|
TheEternalVortex wrote: | I changed the script a bit, adding an option to update, and using xv to set the background image.
|
Excellent! I hadn't thought of an "update the menu" option. Thanks!
Depending on how you have mv set up (some have it aliased to 'mv -i' by default, so you won't go clobbering files by mistake), you could use mv -f source dest. |
|
Back to top |
|
|
Can O' Beans n00b
Joined: 12 Dec 2002 Posts: 50
|
Posted: Sat Jan 11, 2003 6:30 pm Post subject: |
|
|
This is an old post, but it helped me out. I used Wimac's script, but edited it to work with the default settings in the current Fluxbox - just basically changing a few of my own custom dirs, and switching his "bgMenu" to Flux's default "imagebgmenu" - as well as chaning "[submenu] (backgrounds)" to include a "{choose background...}"
Code: |
#!/bin/bash
PIC_DIR=/usr/share/commonbox/backgrounds
SEARCH_PICS=/usr/share/commonbox/backgrounds
#
# background display type for Esetroot: -fill -scale -center -mirror
#ie, how you want pic dislplayed
ESETTYPE=-scale
BGMENU_PLACE=/usr/share/commonbox
find $SEARCH_PICS -name '*.jpg';
find $SEARCH_PICS -name '*png';
find $SEARCH_PICS -name '*bmp';
rm $BGMENU_PLACE/imagebgmenu
rm $BGMENU_PLACE/imagebgmenu.tmo
echo -e "[submenu] (Backgrounds) {Choose background...}" >> $BGMENU_PLACE/imagebgmenu.tmo
for JPEG in $PIC_DIR/*.jpg
do
echo -e "[exec] ($JPEG) {Esetroot $ESETTYPE $JPEG}" >> $BGMENU_PLACE/imagebgmenu.tmo
done
for PNG in $PIC_DIR/*.png
do
echo -e "[exec] ($PNG) {Esetroot $ESETTYPE $PNG}" >> $BGMENU_PLACE/imagebgmenu.tmo
done
for BMP in $PIC_DIR/*.bmp
do
echo -e "[exec] ($BMP) {Esetroot $ESETTYPE $BMP}" >> $BGMENU_PLACE/imagebgmenu.tmo
done
echo -e "[end]" >> $BGMENU_PLACE/imagebgmenu.tmo
#this takes the directory part of the file name out of the menu
#after the first ( put the PIC_DIR, but put \ b4 each / in the dir name to delimitit it
# ie /home/war_pig/ becomes \/home\/war_pig\/
sed -e 's/(\/usr\/share\/commonbox\/backgrounds\//(/g' $BGMENU_PLACE/imagebgmenu.tmo >> $BGMENU_PLACE/imagebgmenu
echo "done"
exit 0
|
This will make your backgrounds list in the default Settings -> backgrounds menu option. You will just have to rerun the script when you add backgrounds. |
|
Back to top |
|
|
ChojinDSL l33t
Joined: 07 Jul 2003 Posts: 784
|
Posted: Sat Jul 12, 2003 2:31 pm Post subject: |
|
|
Ok, dont laugh at my super-noob question , but how do I use this script.
Do I just copy+paste the text and save it as a file? where do I need to put it, what do I name it? |
|
Back to top |
|
|
barryboring n00b
Joined: 09 Jul 2003 Posts: 19
|
Posted: Sat Jul 12, 2003 11:22 pm Post subject: |
|
|
Hello,
Chojin: You do indeed need to cut and paste and save it as a file. Whatever name you like, wherever you like with a trailing .sh. eg. backgrounds.sh
Then make the file executable;
Code:
chmod +x backgrounds.sh
Then run the file as root.
bb |
|
Back to top |
|
|
ChojinDSL l33t
Joined: 07 Jul 2003 Posts: 784
|
Posted: Sun Jul 13, 2003 1:56 pm Post subject: |
|
|
And Im guessing that all my background image files go into the background directory of commonbox? |
|
Back to top |
|
|
|