Translation(s): English - Brasileiro - Français - Italiano - Русский - Español
Some information on the Fluxbox window manager.
Contents
Introduction
In Unix computing, Fluxbox is a fast and light WindowManager for the X Window System based on Blackbox 0.61.1. and compatible with it. It has support for KDE and Gnome applications.
Unlike the heavyweights, GNOME and KDE Plasma, which take (ideally) 15-30 seconds to get up and running, Fluxbox is up and running as soon as you hit the enter key. Its menu and configuration is done by simple files located in the user's directory under the name .fluxbox.
Fluxbox has a slick tabbing mechanism for windows. You can combine multiple windows into one window with tabs across the top by simply middle-clicking the tab of one window (and holding it down) and dragging and dropping on the tab of another window. This is very nice for cleaning up a desktop without exiling applications to other virtual desktops (it has those too).
Another nice feature is Fluxbox's support for docking applications. A docking app runs as sort of an icon with minature display or controls. But not like an icon, more like small controls on a walkman (for example) as opposed to a big dial face of a home stereo. It aims to be lightweight and highly customizable, with only minimal support for graphical icons, and only basic interface style capabilities. The basic interface has only a TaskBar and a menu accessible by right-clicking on the desktop. Fluxbox also supports user created keyboard shortcuts.
Fluxbox is an amazing piece of software that does not depend on any other WindowManager. It is small, fast and almost a sure thing for pleasing the eye. (Source < 500K). You can choose any one of many pre-defined styles to tailor it to your taste. It can be used with DebianLive on small USB keys.
In accordance with Fluxbox's goal of simplicity, the main menu, the keyboard shortcuts and the basic configuration are all changed by editing text files. Fluxbox's themes are 100% compatible with those of blackbox. Colors, gradients, borders, and several other basic appearance attributes can be specified; recent versions of Fluxbox support rounded corners and graphical elements. Fluxbox also has several features which blackbox lacks, including Tabbed Windows, a feature familiar from PWM, and configurable titlebar.
Installation
If you do not have X installed, you need to install X first, using Aptitude or apt-get:
# apt-get install xorg
After you can install Fluxbox.
# apt-get install fluxbox
You can use Fluxbox with xdm now.
The fluxbox package contains the following tools:
- fluxbox: the Fluxbox window manager
- fbsetbg: script to setup the rootwindow's background
fbrun: small RunApplication tool
- startfluxbox: Fluxbox starter that reads session information from ~/.fluxbox/startup
Fluxbox Session
SDDM and GDM
To start a Fluxbox session from SDDM or GDM you can choose 'fluxbox' from the session or session-type menu.
XDM
To run Fluxbox from xdm you should setup a .xsession file in your home_directory.
exec startfluxbox
Alternatively use the debian alternatives and setup x-session-manager to be Fluxbox.
SLIM
By default SLIM uses Xsession which is provided with /usr/share/xsessions/fluxbox.desktop.
From Commandline
To run Fluxbox from the commandline login, setup the .xinitrc file in your Home directory and insert the following line:
exec startfluxbox
Alternatively use the Debian alternatives and setup x-window-manager to be Fluxbox.
XDG
Install fbautostart and add it to your ~/.fluxbox/startup to provide automatic startup of XDG applications ( ls /etc/xdg/autostart ~/.config/autostart ).
# fbautostart has been added with a quick hack to check to see if it # exists. If it does, we'll start it up by default. which fbautostart > /dev/null # shellcheck disable=SC2181 if [ $? -eq 0 ]; then fbautostart & fi
Configuration
Keyboard Shortcuts
It is possible to set up a wide range of keyboard shortcuts for Fluxbox using the ~/.fluxbox/keys configuration (although it is possible to use another name and specify it in ~/.fluxbox/init). The key file has a rather simple and clean layout, as shown in the following example:
# fluxbox keys file Mod1 Tab :NextWindow Mod1 Shift Tab :PrevWindow Mod1 F1 :Workspace 1 Mod1 F2 :Workspace 2 Mod1 F3 :Workspace 3 Mod1 F4 :Workspace 4 Mod1 a :Maximize Mod1 h :MaximizeHorizontal Mod1 v :MaximizeVertical Mod1 q :ExecCommand aterm Mod1 d :ToggleDecor # Example of macro commands # Position and resize windows to half of the screen in various positions Mod4 Mod1 111 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Up} Mod4 Mod1 113 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Left} Mod4 Mod1 114 :MacroCmd {ResizeTo 50% 100%} {MoveTo 00 00 Right} Mod4 Mod1 116 :MacroCmd {ResizeTo 100% 50%} {MoveTo 00 00 Bottom} # As before but only use a quarter of the screen Mod4 Mod1 Shift 111 :MacroCmd {ResizeTo 50% 50%} {MoveTo 50% 00% Up} Mod4 Mod1 Shift 113 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00% 00% Up} Mod4 Mod1 Shift 114 :MacroCmd {ResizeTo 50% 50%} {MoveTo 50% 50% Up} Mod4 Mod1 Shift 116 :MacroCmd {ResizeTo 50% 50%} {MoveTo 00% 50% Up} # Example of the simple tiling features Mod4 a :ArrangeWindows Mod4 v :ArrangeWindowsVertical Mod4 h :ArrangeWindowsHorizontal Mod4 x :ArrangeWindowsHorizontal (Name=[current]) Mod4 z :ArrangeWindowsVertical (Name=[current])
So the general layout is:
<modifier> <key> [...] :<operation>
NOTE: The following tables are not complete!
modifier |
key on the keyboard |
Mod1 |
Alt |
Mod4 |
OS, a.k.a. Win-key |
Control |
control key |
Shift |
shift key |
keys |
key on the keyboard |
a-zA-Z0-9 |
letters and digits, case insensitive |
Escape |
the escape key |
Right|Left|Up|Down |
Arrow-keys beyond the Home/End keys |
Tab |
tabulator key |
Delete |
delete key |
operations |
action |
Workspace N |
switch to workspace N |
PrevWindow|NextWindow |
cycle to prev/next window on current workspace |
Exec|ExecCommand |
execute the following arguments |
FullScreen |
toggle fullscreen for the current window |
ToggleDecor |
toggle window decorations |
Maximize[Horizontal|Vertical] |
toggle maximize for current window |
NextTab|PrevTab |
switch between tabs |
MoveTo x y |
move the current window to coordinates (x,y) (where (0,0) is the upper left corner) |
ArrangeWindows |
automatically arrange windows on current desktop |
RootMenu |
popup the rootmenu on the cursor's position |
Modifier, keys and operations are not case sensitive. It's a matter of readability in this case.
Background
To load a personalized background on startup and prevent theme switches from changing it, you have to put (or remove the comment if it's there already).
! The following line will prevent styles from setting the background. background: unset
in ~/.fluxbox/overlay
Then set the background once manually with fbsetbg. This last used wallpaper will be saved in the file ~/.fluxbox/lastwallpaper.
Apps
With the ~/.fluxbox/apps file you can for instance open a window always maximized, with specific dimensions, only on the left display or even on another workspace.
Simple settings might be changed by right-click on the menu-bar and select one of the checkboxes in the "Remember" submenu. By doing so an '[app]..' line will be created in the configuration if it doesn't exist already. For more granular matching you might want to look at the CLIENT PATTERNS section.
For permanent use of the window tabbing feature you need to edit the configuration file manually. This is an example how this could be achieved:
# PDF-Viewers grouped and always on the left side for half of the screen. [group] (workspace=[current]) [app] (name=atril) (class=Atril) [app] (name=evince) (class=Evince) [app] (name=win) (class=Xpdf) (title=.*) [Dimensions] {50% 100%} [Position] (UPPERLEFT) {0% 0%} [end] # Web, Mail, and more - always Maximized [group] [app] (name=claws-mail) (class=Claws-mail) (role=mainwindow) [app] (name=claws-mail) (class=Claws-mail) (role=compose) [app] (name=claws-mail) (class=Claws-mail) (role=messageview) # opened by using `xterm -e alpine` [app] (name=alpine) (class=XTerm) (title=alpine) [app] (name=linphone) (class=linphone) [app] (name=speedcrunch) (class=SpeedCrunch) [app] (name=twinkle) (class=twinkle) [app] (name=Navigator) (class=Firefox-esr) (role=browser) [app] (name=Navigator) (class=Iceweasel) (role=browser) [app] (name=qutebrowser) (class=qutebrowser) [Deco] {NORMAL} [Maximized] {yes] [end]
The default key combination for switching between tabs is Mod4(Logo-Key)+Tab.
The following shell function can be used to quickly create the shown '[app]..' lines.
fbxprop () { printf '[app] %s \n[end]\n' "$( xprop WM_CLASS WM_NAME WM_WINDOW_ROLE | \ sed 's/WM_\(.*\)(\(.*\)) = "//g;s/", "/\n/;s/"$//'| \ sed '1 s/^/(name=/;2 s/^/(class=/;3 s/^/(title=/;4 s/^/(role=/;s/$/)/g' | \ # WM_WINDOW_ROLE might not be found grep -v WM_WINDOW_ROLE |tr '\n' ' ')" }
Slit
The slit is a special window frame that can contain dockable applications, e.g. 'bbtools' or 'wmapps'.
When applications are run in the slit they have no window borders of their own; instead they are framed in the slit, and they are always visible in the current workspace.
You can click button 3 on the edge of the slit window to get a menu to configure its position, whether the applications it contains should be grouped horizontally or vertically and whether the slit should hide itself when the mouse moves away.
Most dockable applications use the -w option to run in the slit. For example, you could put in your ~/.xinitrc:
bbmail -w & bbpager -w & wmdrawer & exec fluxbox
NOTE: You can also put all of these in the startfluxbox(8) script. This way you would only need to specify: exec startfluxbox in your ~/.xinitrc.
Slitlist File
Fluxbox's slitlist file is available for those that use dockapps in the slit. This file helps Fluxbox keep track of the order of the dockapps that you want started. The file is usually located in ~/.fluxbox/slitlist.
A simple procedure for getting the slit sequence the way you like it is:
- Run Fluxbox with no pre-loaded dockapps
- Run dockapps individually in the order you want them
- Add dockapps to your auto-run script, or better yet your startfluxbox(8) script.
This sequence will be saved by default to ~/.fluxbox/slitlist and will be kept in future versions of Fluxbox.
Users are free to manually edit the slitlist file. It is a simple list of window names, one per dockapp. Similar to the init file it should not be edited while Fluxbox is running. Otherwise changes may be overwritten.
The user also has the option of choosing a different path for the slit list file. The following is the init file component that needs to be changed:
session.session0.slitlistFile: <filename>
Remote Commands
By setting session.screen0.allowRemoteActions: true in ~/.fluxbox/init you can use all commands mentioned in fluxbox-keys from the shell or even a script. For instance if you change settings in a configuration-file which require a reload use fluxbox-remote reconfigure. You might even restart fluxbox completely with fluxbox-remote restart. This will not end your running applications! As another example lets open the Application-Menu with fluxbox-remote rootmenu or select another window with fluxbox-remote 'Activate (name=xterm)'.
Look and Feel inside Applications
Because Fluxbox is just a Window-Manager and not a fully fledged Desktop-Environment it might be a bit of work to get your Applications look like you want them to be.
Changing GTK themes
For GTK 2 use either gtk-theme-switch or gtk-chtheme. For GTK 2 and 3 you can use lxappearance. There are many themes available in Debian, some are listed with the following command apt list '?depends(~ngtk2-engines)|~ngtk2-engine'.
This shows you how to edit GTK settings without any extra application installed.
Create or edit the ~/.gtkrc-2.0 file. In that file input parameters such as the following:
#sets the font gtk-font-name = "sans 7" #sets the theme gtk-theme-name = "niroki" #sets the icon theme gtk-icon-theme-name = "SimplyGrey" #shows only icons in the toolbar gtk-toolbar-style = GTK_TOOLBAR_ICONS #shows small icons in the toolbar gtk-toolbar-icon-size = GTK_ICON_SIZE_SMALL_TOOLBAR
Changing QT themes
For QT you can use qt5ct and qt6ct to choose your theme.
Further Information
See also Xinitrc, FluxboxIcon.
External links
Fluxbox themes
Currently down: tenr.de-styles.tar.bz2
Debian-based Fluxbox Distros
CategoryDesktopEnvironment CategorySoftware CategoryXWindowSystem