Using Fluxbox

Fluxbox presents a unique desktop experience. Whilst it is often used in 'light-weight' distros because of it's low memory print, beneath the surface it is actually quite powerful. Here are some tips and links to get the most from your TinyFlux experience.

1. The Desktop

Fluxbox does not natively have a standard desktop with desktop icons. All applications are launched via the menu which is available by right-clicking on the desktop. This is all part of the unique experience. It is just as quick, if not quicker, to use the Flux menu rather than desktop icons and it allows you see your wallpaper in all its glory! If you want the menu to disappear, left-click elsewhere. To this end, you will not find a /home/user/desktop directory and you cannot save files onto the desktop.

If you do want desktop icons, you'll need to install iDesk from Synaptic. Here's some instructions:
http://gentoo-wiki.com/HOWTO_Fluxbox#Icons_using_Idesk


2. Wallpaper/Background

The default wallpaper in all PCFluxboxOS remasters is a 1024x768 resolution jpeg. If you are using a different screen resolution you might want to set an appropriate wallpaper for that resolution:
800x600
1280x1024
1600x1200

You can of course set your own wallpaper.

2.1 The easy method

In the menu click on Fluxbox menu|Wallpapers and then click on whichever wallpaper you want and it will automatically be set.

If you have your own wallpaper, save it first to /Pictures/Wallpapers in your home folder and then it will appear in the list in the menu.

2.2 The CLI method

Fluxbox uses a clever command that checks the system for a suitable graphic program (in this case Esetroot) for displaying the wallpaper. The command is:

fbsetbg /path/to/wallpaper

You can pass other arguments to the command:
-f Set fullscreen wallpaper
-c Set centered wallpaper
-t Set tiled wallpaper
-a Set wallpaper maximised with preserved aspect.
-i Tell the user the program it is using to set the wallpaper and any pitfalls it might have.
-l Set last wallpaper

Fluxbox remembers the last set wallpaper to display at login by virtue of a line in the ~/.fluxbox/fluxbox.ini file:

session.screen0.rootCommand: fbsetbg -l

For tips on using fbsetbg run this command:

fbsetbg -p

2.3 References

http://www.xs4all.nl/~hanb/software/fbsetbg/fbsetbg.html
http://fluxbox-wiki.org/index.php/Howto_set_the_background
http://mandrivausers.org/index.php?showtopic=18972


3 Edit the Fluxbox menu

When you install a new application, unlike KDE or GNOME, it won't automatically appear in the menu. Menu items don't disappear after uninstallation either. However, it only takes a few seconds to add a menu entry, once you know how.

3.1 The manual method

As with all things in Fluxbox, altering the appearance often comes down to editing a simple text file. Editing the menu is no exception. We have included a handy link to the correct file in the Flux menu. Right-click on the desktop to bring up the menu and then choose Fluxbox menu|Tools|Edit fluxbox menu and your menu file will open up in Medit.

Editing the menu is reasonably painless, but you might want to backup your menu first. Click on File|Save As and save the file as menu.old. Close the file and then reopen it from the Flux menu.

You only need to know a few commands to add an application from the menu:

[exec] (name you want it to appear in the menu) {command to start the application}

Most application commands are just the name of the application. For instance to start xterm, the command is xterm! So the menu entry could be:

[exec] (Terminal) {xterm}

It is worth checking the command by typing it the Run Command and pressing enter. If the application launches then you have the correct command. Most of the application executables are found in the directory /usr/bin and you can have a look in there for the correct command. Some are also found in /usr/sbin and /usr/local/bin. If this is the case, then you'll need to type the path, eg:

[exec] (Package Manager) {/usr/sbin/synaptic}

You can always use SearchMonkey to find the exact location of the executable.

Just look at the existing entries and you'll get a good idea.

You can divide menu entries into submenus. Just start and end a submenu group as follows:
[submenu] (name of submenu)
[exec] (name) {command}
[exec] (name) {command}
[end]

When you have finished editing, click on Save and then close Medit. Next time you open the menu, your new additions should appear.

It is possible to add icons to the fluxmenu. The latest version of Fluxbox should support PNG or JPEGs but certainly pre version 1, only XPM image files were supported. I've found menu icons don't add much to the experience, and that is why they are not included by default in PCFluxboxOS. Anyway, if you want to add a menu icon, you'll need something no larger than 32x32 pixels and just add the path to the end of the menu entry:

[exec] (Terminal) {xterm} <path/to/xterm.xpm>

3.2 Use Fluxmenu

Fluxmenu is a graphical tool to configure your fluxbox menu. It is still in development, so it hasn't been included in PCFluxboxOS yet. If you want to download and try it, follow this link:
http://fluxmenu.berlios.de/

The developers of Fluxmenu have also created other interesting sounding Fluxbox utilities.

3.3 References

http://fluxbox.sourceforge.net/docs/en/newdoc.menuedit.php
http://wiki.linuxquestions.org/wiki/Fluxbox_Menu


4. Keyboard Shortcuts

Fluxbox can be configured to use keyboard shortcuts. The keys file is the config file you want, as always, located in ~/.fluxbox

4.1 Pre-configured Keyboard Shortcuts

I have already set up a number of keyboard shortcuts for the PCFluxboxOS series:

  • Ctrl + Esc = Task manager (this is the default KDE shortcut, you could change it to Ctrl + Alt +Del if you want)
  • Ctrl + Alt + Home = Opens file manager in your home directory
  • Window key = Brings up the Fluxbox root menu
  • Ctrl + Window = Brings up workspaces menu
  • Alt + T = terminal
  • Alt + B = web browser
  • Alt + E = email
  • Alt + W = word processor
  • Print screen = takes a screen shot of the whole screen in mtPaint

4.2 Configure your own keyboard shortcuts

Configuring your own keyboard shortcuts is relatively easy, once you know the syntax.

  • Open your keys file in an editor
  • You'll see a number of lines starting with the hash symbol #. These are comments to help you figure out the syntax.
  • The basic syntax for a keyboard shortcut is:
    • Key code: command the space after the colon is important
  • The command can be to execute a program, Fluxbox command or mouse event. It even supports macros.
  • To find out the key code, run xev in a terminal and then press a key. This should return the key name or at the very least the key code.
  • The most common codes are:
    • Mod1 == Alt
    • Mod4 == Windows key (sometimes known as Super_L)
    • Control == Ctrl
    • Shift == Shift
  • To create a shortcut to a program, just add ExecCommand followed by the command:
    • Mod1 w: ExecCommand abiword == alt + w = starts abiword
  • There's an extremely comprehensive guide at the Fluxbox Wiki

More info coming soon!
Also check out: http://linux.die.net/man/1/fluxbox

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License