Fluxbox Menu

From LQWiki
Jump to navigation Jump to search

There are two ways to create a fluxbox menu.

  • manually edit
  • run fluxbox-generate_menu

fluxbox-generate_menu will add a lot of "stuff" to the menu.

Custom Fluxbox Menu with Icons

One of the great things about fluxbox is how easy it is to edit the menu.Once we have set up ~/.fluxbox/init to read our menu and not the default in /root or changes will be saved.If when you edit your menu and it doesn't change anything thats the first place to look.

Sample Menu

[begin] (Gentoo.tux)
     [exec]    (aterm) {aterm -fn -*-fixed-medium-r-*-*-15-120-*-*-*-*-iso8859-1}</home/david/icons/icons/shutdown_32x32.xpm>
     [exec]    (Eterm) {Eterm}</home/david/icons/icons/terminal3_32x32.xpm>
     [exec] (firefox) {firefox}</home/david/icons/icons/firefox_32x32.xpm>
     [exec] (Run) {fbrun }</home/david/icons/icons/run_32x32.xpm>
[submenu] (Terminals)
     [exec] (xterm) {xterm -bg black -fg white -fn -*-fixed-medium-r-*-*-15-120-*-*-*-*-iso8859-1}</home/david/icons/icons/terminal3_32x32.xpm>
     [exec] (gnome-terminal) {gnome-terminal}</home/david/icons/icons/terminal_32x32.xpm>
     [exec] (Eterm) {Eterm}</home/david/icons/Computer.xpm>
     [exec] (aterm) {aterm}</home/david/icons/icons/terminal3_32x32.xpm>
     [exec] (Eterm-DT) {Eterm --trans -x --scrollbar=off --buttonbar=off -f white -g 80x25+600+150}</home/david/icons/cross.xpm>
[end]
[submenu] (HTML)
     [exec] (gftp) {gftp}</home/david/icons/icons/xconsole_32x32.xpm>
     [exec] (cssed) {cssed}</home/david/icons/icons/xedit_32x32.xpm>
     [exec] (bluefish) {bluefish}</home/david/icons/icons/bluefish_32x32.xpm>
[end]      
[submenu] (Net)
[submenu] (Browsers)
     [exec] (epiphany) {epiphany}</home/david/icons/icons/ethereal_32x32.xpm>
     [exec] (firefox) {firefox}</home/david/icons/icons/firefox_32x32.xpm>
     [exec] (mozilla) {mozilla}</home/david/icons/icons/mozilla_icon_32x32.xpm>
[end]
[submenu] (Mail)
     [exec] (evolution) {evolution}</home/david/icons/icons/evolution_32x32.xpm>
[end]      
[end]
[submenu] (Editors)
     [exec] (gedit) {gedit}</home/david/icons/icons/xedit_32x32.xpm>
     [exec] (xedit) {xedit}</home/david/icons/icons/find_32x32.xpm>
[end]
[submenu] (File utils)
     [exec] (nautilus) {nautilus --no-desktop --browser}</home/david/icons/icons/xfmail_32x32.xpm>
[end]
[submenu] (Graphics)
     [exec] (gimp) {gimp-2.2}</home/david/icons/icons/gimp_hi_32x32.xpm>
[end]
[submenu (Multimedia)
[submenu] (Audio)
     [exec] (xmms) {xmms}</home/david/icons/icons/xmms_32x32.xpm>
     [exec] (beep) {beep-media-player}</home/david/icons/icons/multimedia_32x32.xpm>
     [exec] (AlsaMixer) {Eterm -e alsamixer}</home/david/icons/icons/mixer_32x32.xpm>
     [exec] (ripperX) {ripperX}</home/david/icons/icons/x_32x32.xpm>
     [exec] (streamtuner) {streamtuner}
[end]
[submenu] (X-utils)
     [exec] (xfontsel) {xfontsel}
     [exec] (xman) {xman}
     [exec] (xload) {xload}
     [exec] (editres) {editres}
     [exec] (viewres) {viewres}
     [exec] (xclock) {xclock}
     [exec] (xmag) {xmag}
[end]
[submenu] (Office)
     [exec] (xclock) {xclock}
     [exec] (xcalc) {xcalc}
[end]
[submenu] (fluxbox menu)
     [config] (Configure)
[submenu] (Styles) {Select a Style}
     [include] (/usr/share/fluxbox/menu.d/styles/)
[end]
     [workspaces]   (Workspace List)
[submenu] (Tools)
     [exec] (idesktool) {idesktool}
     [exec] (Window name) {xprop WM_CLASS|cut -d \" -f 2|xmessage -file - -center}
     [exec] (Run) {fbrun }
     [exec] (Regen Menu) {fluxbox-generate_menu}
[end]
[submenu] (Window)
     [restart] (gnome) {gnome-session}
[end]
     [commanddialog] (Fluxbox Command)
     [reconfig] (Reload config)
     [restart] (Restart)
     [exec] (About) {fluxbox -v 2>/dev/null  | head -n1 | xmessage -file - -center}
     [separator]
     [exit] (Exit)
[end]
[end]
Some menu items were too wide to fit on one line here,they should be on the same line

Customise the Layout

In the Above menu to add two subsections to the Net section the subsection is closed with
[end]
[end]
This produces the the two subsections in Net
Browsers
Mail

Menu Icons

To add the icons to the menu,first create the Icon directory

Make sure you are in your home directory and please don't su to root;

cd
mkdir Icons

Download these icons to /home/yourname/Icons
iceicons

next untar them
cd Icons
ls (to see if they are there)
tar xzvf <filename>

Now all you have to do is add it to your menu like this

[exec] (aterm) {aterm</home/yourname/Icons/whatever-the-name-is.xpm>