A Very Simple Fluxbox Config

Not really satisfied with the pre-configured bspwm session that was shipped with Archcraft, I decided to get familar with other window managers that may provide me a simple fallback solution to my main session running Openbox. As much as I tried to give i3wm yet-another-fair chance, I just can't warm up to it, so I eventually settled with a cousin of Openbox, namenly Fluxbox.

Since Fluxbox is, just like Openbox, a fork of Blackbox, it shares a decent amount of similarities with my main WM, so getting familiar with it consumed less time. But the first difference that quickly became apparent to me was the documentation, which is even more sparse than that of Openbox. While understanding the differing syntax wasn't an issue, only half of the automatically-generated files rely on comments and a readable structure. The default menu is hardly usable when you don't use xterm and Firefox – and even if you have Firefox installed, the menu entry leaves “Firefox” empty for no obvious reason.

It usually is recommended to use menumaker to generate a more useful menu and it did help me get some access to necessary programs like Alacritty/Xfce Terminal, Thunar and LibreWolf. Still, even Menu Maker created plain useless entries of programs not even installed whilst missing tools such as Glances.

The easiest part was the addition of new entries to copy my Openbox menu, yet instead of calling the powermenu scripts, which are tied to this particular Openbox configuration, simply bootstrapping betterlockscreen and systemctl without confirmation prompts suffices.

Style

I firt downloaded fluxmod-styles due to the pre-installed styles being... meh. Editing them and creaing my own out of those was fairly easy.

Startup

The autostart script is very minimal by default and requires manual adjustments. Adding the necessary software to run in the background (dunst, nm-applet, xfsettingsd, xfce4-power-manager) and linking .fehbg to set a different background than the one used by nitrogen was what I assumed would be enough. Of course it wasn't and that's when I began to notice the first inconsistent behavior of Fluxbox on different machines.

While both Openbox configurations are virtually identical and EndeavourOS already providing a .fehbg file, both Openbox machines executed Feh differently, with the Asus continiously refusing to generate said file. Polybar also refused to get launched, despite setting the correct path to launch.sh, on only one machine, even though both Polybar configs are identical.

Toolbar

Speaking of Polybar, two out of three configs are set to launch this bar, instead of the one provided by Fluxbox. The only configuration without Polybar needed some editing (as the German “Arbeitsfläche” didn't mesh well with the menu that' kept in English) and the installation of missing systray icons, especially cbatticon, nm-applet (oops) and volumeicon.

And that's when I noticed that the vast majority of my keybindings relying on the function key (Fn) didn't work on my Asus.

Keybinds

Keybinds always are a matter of taste but this one caused me the most amount of headaches. The defaults are not even remotely similar to what I'm familiar with, so just to get my most important shortcuts to work, I edited those. Eventually I was confronted with an annoying drawback of X on Asus machines.

For some odd reason, Openbox easily recognizes Fn + F5 to increase display brightness; Fluxbox does not and xev lists this keybind as empty but only when running Fluxbox. In fact, the empty combination Fn + F3 is suddenly being listed as “Mail”. Strangely, Openbox does call the appropriate keymap of my Asus X553MA. To circumvent this, the correct keybinds were set with xfce4-settings, instead. The audio key remained blocked, though, and this was caused by Fluxbox defaulting to its own default configuration.

The default keys to change audio settings are being shipped not with simple keybinds but require the exact keycodes to call amixer. Keycodes are hardware-dependent and thus vary greatly between machines; amixer is a classic tool, yet perhaps not the most used choice when most people rely on either Pipewire or PulseAudio. While I simply had to comment this section on my Acer, my Asus required XF86Audio directly from Fluxbox. Some keybinds still are missing on this laptop at the time of writing this.

TL;DR

Out of my three configs, the one currently running on my Acer Aspire is the most stable and complete (and my most favorite). All dotfiles will be published on my GitHub once my Asus and HP configs are complete, as well, but for now I'll only include the most important configs from my Acer here.

init

Simply changed two settings; the rest relies on defaults:

session.screen0.toolbar.tools: prevworkspace, workspacename, nextworkspace, iconbar, systemtray, clock session.screen0.toolbar.placement: TopCenter

keys

Still largely defaults but with some important changes and additions:

# open a terminal Mod4 Return :Exec alacritty

# volume settings, using common keycodes # if these don't work, use xev to find out your real keycodes XF86AudioRaiseVolume :Exec pactl set-sink-volume @DEFAULT_SINK@ +5% XF86AudioLowerVolume :Exec pactl set-sink-volume @DEFAULT_SINK@ -5% XF86AudioMute :Exec pactl set-sink-mute 0 toggle

# exit fluxbox Control Alt q :Exit

# take a screenshot (full) Print :Exec scrot 'Screenshot_%Y-%m-%d-%I-%M-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PICTURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' Print s :Exec scrot -s 'Screenshot_%Y-%m-%d-%I-%M-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PIC TURES) ; viewnior $$(xdg-user-dir PICTURES)/$f' Print u :Exec scrot -u 'Screenshot_%Y-%m-%d-%I-%M-%S_$wx$h.png' -e 'mv $f $$(xdg-user-dir PIC TURES) ; viewnior $$(xdg-user-dir PICTURES)/$f'

Just the main changes from the Menu Maker default:

[begin] (FluxBox) [exec] (Terminal Emulator) {alacritty} [exec] (Web Browser) {librewolf} [exec] (File Manager) {thunar} [exec] (Text Editor) {leafpad} [separator] ... [submenu] (FluxBox) [workspaces] (Workspaces) [submenu] (Styles) [stylesdir] (/usr/share/fluxbox/styles) [stylesdir] (~/.fluxbox/styles) [end] [config] (Configure) [reconfig] (Reconfig Fluxbox) [restart] (Restart Fluxbox) [separator] [exit] (Logout) [exec] (Lock) {betterlockscreen --lock} [exec] (Suspend) {betterlockscreen --suspend} [exec] (Reboot) {systemctl reboot} [exec] (Shutdown) {systemctl poweroff} [end] [end]

startup

.xmodmap disabled, few additions:

# Applications you want to run with fluxbox.

# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.

#

nm-applet & dunst & cbatticon & volumeicon & xfce-power-manager & xfsettingsd &

# Set wallpaper

~/.fehbg &

Style

“bunker-one-xpm-mod” – same as the original but with minor tweaks. It requires an overlay (set in overlay) to prevent the style's default background from loading:

Blue: #3976b7

toolbar:Flat Gradient Vertical