May 16, 2009

Fluxbox menu setup

I am using the XFCE edition, and the paths in my menu will reflect the use of GTK apps like Thunar, rather than the QT apps. (anything KDE).

One easy way to learn about files in fluxbox, is the hands on approach. With Fluxbox this is easily accomplished with minimal risk.

*Files & Folders Note: It is a good idea to make a folder specifically for downloads and or other files in your /home directory.

'Rightclick' in ~ /home, and 'create folder'. Name it whatever you want.
Anything you download or copy should go into that folder for unpacking and/or checking out, before moving your newly unpacked files/folders to their final destination. This is just good practice for minimizing risks.

In order to get started:

In your ~/.fluxbox folder, make a new file and name it menu1. Copy and paste the menu below into that file. In order to point Fluxbox to use menu1 as the main menu, just open your ~/.fluxbox/init file, and change the line that reads:

session.menuFile ~/.fluxbox/menu


session.menuFile: ~/.fluxbox/menu1

Save your file and exit.

Restart Fluxbox and you will be presented with a new menu, which has a setup more suited to easy use and learning.
More so, if you do any of the rest of the tweaks I write, you will already be set up without having to do anything but start exploring.

I have listed in menu1 some of the most common items, with an option to open the full 'Debian' menu if needed.
In menu1 you will find:
1. Access to the internet through iceweasel, with a few pages preset to get you started.
2. A sub section named 'SU' with paths to 'root' xfce terminal, thunar, and synaptic..
3. A sub section just for Audio/Video that has a few applications already listed.
4. A path to the Debian menu with an option to update your menus on the fly.
5. A section for toggles.
6. Paths to XFCE settings, Fluxbox settings
6. Options to restart fluxbox, exit to login, reboot, and shutdown. I will show a how to a little later how to set this up for use without a password. In ~/.fluxbox/menu1 you will see an option to UN-comment two lines that will allow this feature, but some other changes need to be made as well.

Change menu1 however you like. If you screw it up, no worries. Worst case, you log back into xfce (or kde) and change the line in ~/.fluxbox/init that you changed earlier by simply removing the '1' and restarting Fluxbox. Presto-Chango, back to your old menu. Or, simply keep a instance of thunar open, while you edit your [~/.fluxbox/menu1, so that even if you destroy the menu, you can simply copy over with the original menu1.



## Please see for information.

## to use your own menu, copy this to ~/.fluxbox/menu1, 
##or whatever you wish to name it,then edit
## ~/.fluxbox/init and change the session.menuFile path,
## to ~/.fluxbox/menu1
[begin] (Fluxbox)
## ~/.fluxbox/menu1
[exec] (Home) {/usr/bin/iceweasel}
[exec] (Weather) {iceweasel}
[exec] (Bored Eh?) {iceweasel}
[exec] (yahoo) {iceweasel}
#[exec] (Firefox) {~/progs/firefox/firefox}
#[exec] (Swiftfox) {/usr/bin/swiftfox}
[exec] (Canto) {xfce4-terminal --geometry=68X12 --hide-borders --hide-menubar --hide-toolbars -e "canto -u"}
[exec] (Icedove) {/usr/bin/icedove}
[exec] (CheckGMail) {/usr/bin/checkgmail}
[exec] (Pidgin) {/usr/bin/pidgin}
[exec] (Transmission) {/usr/bin/transmission}
[exec] (Thunar) {thunar}
[exec] (Term) {/usr/bin/xfce4-terminal}
[exec] (TermSU) {/usr/bin/gksu -u root /usr/bin/xfce4-terminal}
[exec] (ThunarSU) {/usr/bin/su-to-root -X -c /usr/bin/thunar}
[exec] (Synaptic) {/usr/bin/su-to-root -X -c /usr/sbin/synaptic}
[exec] (Random Wallpaper) {fbsetbg -f -r ~/pictures/wallpapers}
[submenu] (Styles)
[stylesdir] (~/.fluxbox/styles)
[submenu] (Mods)
[stylesdir] (~/.fluxbox/styles/
#[exec] (konqueror) {konqueror}
#[exec] (konsole) {konsole}
[exec] (Abiword) {/usr/bin/abiword}
#[exec] ( Writer) {/usr/bin/oowriter}
#[exec] (X-Terminal as root) {/usr/bin/gksu -u root /usr/bin/xterm}
[exec] (GIMP) {/usr/bin/gimp}
#[exec] (Nexuiz) {/usr/games/nexuiz}
#[exec] (Screensaver) {xscreensaver-demo}
#[exec] (Mypaint) {/usr/bin/mypaint}
[exec] (K3b) {/usr/bin/k3b}
#[exec] (Kcolorchooser) {/usr/bin/kcolorchooser}
[exec] (gcolor2) {gcolor2}
#[exec] (Virtualbox) {/usr/bin/VirtualBox}
#[exec] (Video/list) {mousepad ~/.scripts/ & thunar ~/Videos}
[exec] (Acidrip) {/usr/bin/acidrip}
[exec] (Aqualung) {/usr/bin/aqualung}
[exec] (Ardour GTK2) {/usr/bin/ardour2}
[exec] (Audacious) {/usr/bin/audacious}
[exec] (Audacity) {/usr/bin/audacity}
[exec] (JACK Control) {/usr/bin/qjackctl}
[exec] (avidemux (GTK\)) {/usr/bin/avidemux2_gtk}
#[exec] (Miro) {/usr/bin/miro}
[exec] (Hydrogen) {/usr/bin/hydrogen}
#[exec] (Streamtuner) {/usr/bin/streamtuner}
[exec] (MPlayer) {/usr/bin/gmplayer}
[exec] (Frostwire) {/usr/bin/frostwire}
#[exec] (Random Song) {/usr/bin/xfce4-terminal --geometry=50X12 --hide-borders --hide-menubar --hide-toolbars -H -e ""}
[submenu] (Auto-generated Menu)
[exec] (Regenerate Menu) {update-menus}
[include] (~/.fluxbox/fluxbox-menu)
[exec] (Xkill) {xkill}
[exec] (Xclipboard) {xclipboard}
[exec] (ksnapshot) {ksnapshot}
[exec] (Toggle Video) {~/.scripts/}
[exec] (Toggle Extras) {~/.scripts/}
[exec] (Toggle Conky) {~/.scripts/}
[ToggleCmd {Exec xcompmgr -fF -I-.004 -O-.004 -D2 -cC -t-4 -l-6 -r6} {Exec pkill xcompmgr}] (Toggle Effects)
[exec] (StickyTerm) {/usr/bin/xfce4-terminal --geometry=50X12 --hide-borders --hide-menubar --hide-toolbars}
[exec] (Scripts) {thunar ~/.scripts}
[exec] (Xkill) {xkill}
[exec] (Xclipboard) {xclipboard} <>
#[exec] (Backup) {xterm -hold -e su -c ~/backupscript/bu/}
[exec] (Backup) {/usr/bin/xfce4-terminal --geometry=50X12 --hide-borders --hide-menubar --hide-toolbars -H -e "su -c /home/sleek/backupscript/bu/"}
#[exec] (Backup) {xterm -hold -e su -c ~/backupscript/rbxi/rbxi}
[submenu](System Settings)
[exec] (xfce settings) {xfce4-settings-manager}
[exec] (HPLIP Toolbox) {/usr/bin/hp-toolbox}
[submenu](Flux Settings)
[wallpapers] (~/pictures/wallpapers)
[exec] (Fluxbox Folder) {thunar ~/.fluxbox}
[exec] (Menu1){mousepad ~/.fluxbox/menu1}
[exec] (Startup){mousepad ~/.fluxbox/startup}
[exec] (Init){mousepad ~/.fluxbox/init}
[exec] (Keys){mousepad ~/.fluxbox/keys}
[exec] (Apps){mousepad ~/.fluxbox/apps}
[exec] (StylesFolder) {thunar ~/.fluxbox/styles}
[submenu] (Quit)
[restart] (Restart Fluxbox)
[exit] (Exit to login)
#### these next two lines are to be used with sudoers change in /etc.
#[exec] (Reboot) {sudo /sbin/shutdown -r now}
#[exec] (Shutdown) {sudo /sbin/shutdown -h now}
#### these next two lines are for password use of shutdown
[exec] (Reboot) {su-to-root -X -c /sbin/reboot}
[exec] (Shutdown) {su-to-root -X -c /sbin/halt}

If using the options for Sound events AND the sudoers tweak, you may wish to change out the quit menu with the one below, and then check the paths for your uses.

##### The following code uses fluxbox-remote actions. You must #####
##### change this line in ~./fluxbox/init: session.screen0.allowRemoteActions, to "true" ######
[exec] (Restart Fluxbox) {play ~/.fluxbox/sounds/restart.wav > /dev/null 2>&1 && fluxbox-remote restart}
[exec] (Exit to login) {play ~/.fluxbox/sounds/logout.wav > /dev/null 2>&1 && fluxbox-remote exit}
##### The following two are for use with 'sudoers' change in /etc.(See sidux Fluxbox Wiki/forum.) #####
[exec] (Reboot) {play ~/.fluxbox/sounds/reboot.wav > /dev/null 2>&1 && sudo /sbin/shutdown -r now}
[exec] (Shutdown) {play ~/.fluxbox/sounds/logout.wav > /dev/null 2>&1 && sudo /sbin/shutdown -h now}
##### Following lines are for password use of shutdown and reboot. #####
#[exec] (Reboot) {su-to-root -X -c /sbin/reboot}
#[exec] (Shutdown) {su-to-root -X -c /sbin/halt}
Please comment if you are using this  'how -to'.  All suggestions and comments welcome.  
Click Here!