Positioning windows in Fluxbox

.

Discovery and terminal

I’ve come to like Fluxbox more and more recently. During previous encounters earlier this year, I used the standard terminal emulator of X, xterm. That looked very old-fashioned and outright ugly. I often state that functionality is more important than looks. But xterm dates back to 1984, and you can see that. It’s too much, even for me. Later I switched to lxterminal, which looks a lot better. There are several more choices.

Flexible

Fluxbox (not Flexbox as I sometimes think it’s called) is flexible! From the ArchLinux Fluxbox page I arrived here, and saw that people manage to create any look they want using Fluxbox, whether modern or nostalgic. There’s even this reconstruction of a Windows 3.10 or 3.11 screen, in a style I remember from 1993 or so. Not very useful, but it’s impressive that Fluxbox makes this possible, even though since version 1.3.7 from 2015 it was never updated. It was probably complete and bug free already then.

So if people are able to create so many styles with Fluxbox, I should be able to tune it to my humble needs as well. I want a light and simple Desktop Environment, but it need not even have an actual desktop to put files on, because I never do that. It should be even lighter and more flexible than Bunsenlabs Linux.

In trying to achieve that, one of the Fluxbox configuration files I manipulated was ~/.fluxbox/keys.

Note that although I heavily used documentation for ArchLinux, I put Fluxbox on top of Debian. But you can probably use any Linux distribution you like, Ubuntu, ArchLinux, Alpine Linux, you name it. Install a version without a desktop to start with.

Windows placement like in Bunsenlabs

In Bunsenlabs Boron, and probably also in Bunsenlabs Carbon, you can press Windows ArrowUp to position the current window to the upper half of the screen. Likewise, Windows ArrowLeft puts it at the left half, etc.

The Windows key is sometimes also called Super key, Super_L, or in the Fluxbox keys file, mod4.

With more complicated key combinations, you can position four Windows in a way more akin to a tiling window manager than to a stacking window manager. Super Alt Up makes the window go to the upper left corner, Super Alt Down sends it to lower right, Super Alt Left to lower left, Super Alt Right to upper right.

In Fluxbox, some of those key combinations are used for workspaces. I’m not fond of workspaces, and for now I configured there to be only one. So I could safely disable two of Fluxbox’s many workspace keyboard combos:

#Mod4 Left	: SendToPrevWorkspace
#Mod4 Right	: SendToNextWorkspace

Then I added two blocks to mimic the Bunsenlabs behaviour in fluxbox:

Mod4 Left	: MacroCmd {ResizeTo 50% 100%} {MoveTo  0%  0%}
Mod4 Right	: MacroCmd {ResizeTo 50% 100%} {MoveTo 50%  0%}
Mod4 Up		: MacroCmd {ResizeTo 100% 50%} {MoveTo  0%  0%}
Mod4 Down	: MacroCmd {ResizeTo 100% 50%} {MoveTo  0% 50%}

Mod4 Mod1 Left	: MacroCmd {ResizeTo 50%  50%} {MoveTo  0% 50%}
Mod4 Mod1 Right	: MacroCmd {ResizeTo 50%  50%} {MoveTo 50%  0%}
Mod4 Mod1 Up	: MacroCmd {ResizeTo 50%  50%} {MoveTo  0%  0%}
Mod4 Mod1 Down	: MacroCmd {ResizeTo 50%  50%} {MoveTo 50% 50%}

That’s it. Restart fluxbox, or even just make it reread its config files, and it works.