Fluxbox

From ParabolaWiki
Jump to: navigation, search

Fluxbox is yet another window manager for X11. It is based on the (now abandoned) Blackbox 0.61.1 code, but with significant enhancements and continued development. Fluxbox is very light on resources and fast, yet provides interesting window management tools such as tabbing and grouping. Its configuration files are easy to understand and edit and there are hundreds of fluxbox "styles" to make your desktop look great. Parabola with FluxBox can turn an old Pentium 800 box with just 256MB of RAM into a very usable computer.

1 Installation

Installing Fluxbox is as easy as:

# pacman -S fluxbox

2 Starting Fluxbox

2.1 Method 1: KDM/GDM Login/Session Managers

Users of KDM or GDM will find a new fluxbox entry added to their session menu automatically. Simply choose the fluxbox option from the session menu when logging in.

2.2 Method 2: ~/.xinitrc

Edit ~/.xinitrc and add the following code:

exec startfluxbox 

If you like to have devices automounted (e.g. in Thunar and other file managers), use this code instead:

exec ck-launch-session dbus-launch startfluxbox

See Xinitrc for more details. You then use the "startx" command from a terminal to launch X and your window manager.

2.3 Method 3: SLiM Login Manager

SLiM, the Simple Login Manager, is a favourite of many Parabola users due to its efficiency. SLiM reads ~/.xinitrc, so if you have your .xinitrc correct as above then it should just work. However, if you want to use SLiM to be able to choose between a number of different window managers/desktop environments then edit the sessions variable in /etc/slim.conf to match the names that trigger the case statement in ~/.xinitrc. See Slim and Xinitrc.

3 Configuration

System-wide fluxbox configuration files are in /usr/share/fluxbox while user configuration files are in ~/.fluxbox. The user config files are:

  • init: the main fluxbox resource configuration file. See Editing the init file
  • menu: the fluxbox menu config. See below and Editing the menu file
  • keys: the fluxbox keyboard shortcuts (hotkeys) file. See below and here
  • startup: where to launch startup apps but see below for .xinitrc and also here
  • overlay: a config file to override elements of styles. See here.
  • apps: a config file for remembering the window configuration of specific apps. See here
  • windowmenu: a config file for altering the Window Menu itself: read this

There are a couple of other less important config files in the directory. But the main ones to be concerned with are init, menu, keys and perhaps startup.

3.1 Menu Management

When you first install fluxbox a very basic applications menu will be created at ~/.fluxbox/menu. You access the menu via a right mouse button click on the desktop. As with other lightweight window managers Fluxbox does not automatically update its menu when you install new applications. It is therefore recommended that you install most of the apps you want on your system first and then re-generate or edit the menu. To enhance the menu and add/edit items there are basically four ways to do it:

3.1.1 fluxbox-generate_menu

There is a built-in command provided with fluxbox:

$ fluxbox-generate_menu

This command will auto-generate a ~/.fluxbox/menu/ file based on your installed programs. However, the menu it generates will not be as comprehensive as that generated by "menumaker" (see immediately below).

3.1.2 MenuMaker

MenuMaker is a powerful tool that creates XML-based menus for a variety of Window Managers, including Fluxbox. MenuMaker will search your computer for executable programs and create a menu based on the results. It can be configured to exclude Legacy X, GNOME, KDE, or Xfce applications if desired.

To install MenuMaker:

# pacman -S menumaker

Once installed, you can generate a complete menu and overwrite the default one by running:

$ mmaker -f FluxBox

To see MenuMaker options:

$ mmaker --help

3.1.3 Manually create/edit the menu

Use your favourite text editor and edit the file: "~/.fluxbox/menu" . The basic syntax for a menu item to appear is:

[exec] (name) {command} <path to icon>

...where "name" is the text you wish to appear for that menu item and "command" is the location of the binary, e.g.:

[exec] (Icecat Browser) {/usr/bin/icecat} <path to icecat icon>

If you want to make submenu write:

[submenu] (Name)
...
...
[end]

When done editing save the file and exit. There is no need to restart fluxbox. For more info read editing the fluxbox menu.

3.2 Init

The ~/.fluxbox/init file is FluxBox's primary configuration resource file. You can change the basic functionality of fluxbox, windows, toolbar, focus, etc. Some of these options are also available from the Fluxbox, Configuration Menu. For more detail read Editing the init file.

3.3 Hotkeys

Fluxbox offers basic hotkeys functionality. The fluxbox hotkey file is located at ~/.fluxbox/keys. The Control key is represented by "Control". Mod1 corresponds to the Alt key and Mod4 corresponds to Meta (not a standard key but most users map Meta to the "Win" key). When installed and first run Fluxbox will provide you with a very usable, almost complete set of hotkeys. You should peruse and learn the ~/.fluxbox/keys file to enhance your FluxBox experience.

Example: here is a quick way to control the Master volume:

Control Mod1 Up :Exec amixer set Master,0 5%+  
Control Mod1 Down :Exec amixer set Master,0 5%-

3.4 Workspaces

Fluxbox defaults to having four workspaces. These are accessible using Ctrl+F1-F4 shortcuts, or by using the left mouse button to click the arrows on the toolbar. You can also access workspaces via a middle mouse button click on desktop which pops up the Workspaces Menu.

3.5 Tabbing and Grouping

With at least two windows visible on your desktop middle click on the upper window tab of one window and drag it into the other open window. The two windows will now be grouped together with window tabs in the upper window tab bar. You may now perform a window operation that will affect the entire window "group".

3.6 Background (Wallpaper)

Setting the background in Fluxbox has historically been convoluted, especially where transparency was required. The fluxbox-wiki now has an entry for background setting, so please refer to that.

The easiest way to do it with Parabola is to first of all check that you have a background setting application available:

 $ fbsetbg -i

If not, install either feh, esetroot or wmsetbg using pacman. Then add this "fbsetbg" line to your ~/.xinitrc file, before the "exec" line, e.g.:

 fbsetbg /path/to/my/image.image
 exec ck-launch-session dbus-launch startfluxbox

3.6.1 Swapping Multiple Backgrounds Easily

Place the following submenu in your fluxbox menu:

[submenu] (Backgrounds)
[wallpapers] (~/.fluxbox/backgrounds)
[wallpapers] (/usr/share/fluxbox/backgrounds)
[end]

Then put your background images into ~/.fluxbox/backgrounds or any other folder you specify, they will then appear in the same fashion as your styles.\

3.6.2 Using Feh with FluxBox

Install feh with:

# pacman -S feh

You may add a quick submenu to your ~/.fluxbox/menu file which will allow you to change backgrounds on-the-fly:

[submenu] (Backgrounds)
[backgrounds] (/path/to/your/backgrounds) {feh --bg-scale}
[end]

To make sure fluxbox will load feh background next time start:

1. Make .fehbg executable:

$ chmod 770 ~/.fehbg

2. Then add (or modify) the following line to the file ~/.fluxbox/init:

session.screen0.rootCommand:	~/.fehbg

3. or add (or modify) the following line to the file ~/.fluxbox/startup:

~/.fehbg

3.7 Theming

To install a fluxbox theme extract the theme archive file to a styles directory. The default directories are:

  • global - /usr/share/fluxbox/styles
  • user only - ~/.fluxbox/styles

To create your own Fluxbox styles read Fluxbox_Style_Guide and this style guide.

3.8 The Slit

Fluxbox, WindowMaker and a couple of other lightweight window managers have a "Slit". This is a dock for any application that can be 'dockable'. A docked application is anchored and appears on every workspace. It cannot be moved freely and is not influenced by any manipulation to windows. It is basically a small widget. Dock apps that are useful in such a situation tend to be clocks, system monitors, weather, etc. Visit Dockapps.org

3.9 Autostarting Applications

The Parabola way to autostart apps is to put all code into ~/.xinitrc. Please read Xinitrc. However, fluxbox provides functionality to autostart applications on its own. The ~/.fluxbox/startup file is a script for autostarting applications as well as starting fluxbox itself. The # symbol denotes a comment.

A sample file:

fbsetbg -l # sets the last background set, very useful and recommended.
# In the below commands the ampersand symbol (&) is required on all applications that do not terminate immediately. 
# failure to provide them will cause fluxbox not to start.
idesk & 
xterm &
# exec is for starting fluxbox itself, do not put an ampersand (&) after this or fluxbox will exit immediately
exec /usr/bin/fluxbox
# or if you want to keep a log, uncomment the below command and comment out the above command:
# exec /usr/bin/fluxbox -log ~/.fluxbox/log

3.10 Other Menus

In the "Menu Management" section (above) we were discussing the main "Applications" Menu, called the "Root" menu in fluxbox lingo. FluxBox also has other menus available to the user:

  • Workspaces Menu: middle click on desktop.
  • Configuration Menu: located within the "Fluxbox" section of the "Root" menu.
  • Window menu: right click on the titlebar of any window, or its bar if minimized. Can be edited. See fluxbox-menu man page.
  • Toolbar menu: right click on empty part of toolbar. Also found as a sub-menu within the Configuration Menu.
  • Slit Menu: found as a sub-menu within the configuration menu.

3.11 Transparent rxvt-unicode terminals

Install urxvt:

 # pacman -S rxvt-unicode

Launch urxvt with these options:

 $ urxvt -depth 32 -bg rgba:0000/0000/0000/bbbb -tint grey

Or you can edit your ~/.Xdefaults file and place the equivalent urxvt commands in that file. See Xdefaults for more info.

3.12 A life after xorg.conf

Xorg no longer requires an xorg.conf file. Traditionally this is where you would change your keyboard settings and powersave settings. Luckily there are elegant solutions not using xorg.conf.

3.12.1 Setting your keyboard right

Just add the following line to ~/.fluxbox/startup:

setxkbmap us -variant intl & # to have a us keyboard with special characters enabled (like éóíáú)

Instead of 'us' you can also pass your language code and remove the variant option (ex.: 'us_intl', which works like the command above in some setups). See man setxkbmap for more options.

To make a help function in your menu, just add in ~/.fluxbox/menu:

[submenu] (Keyboard)
      [exec] (normal) {setxkbmap us}
      [exec] (international) {setxkbmap us -variant intl}
[end]

3.12.2 Disable Powersave

Do you recognize the problem while watching a movie that the screen goes blank? Congratulations, Xorg just detected that you were doing nothing :). If you do not need these movement exercises, you can disable this feature altogether. You'll just have to remember to manually turn off your monitor if you're not using it.

Just add the following line at the start of ~/.fluxbox/startup:

xset s off -dpms &

4 Additional Resources

5 Acknowledgement

This wiki article is based on ArchWiki. We may have removed non-FSDG bits from it.