Preface
Every Window Manager has their own challenge.
That is where the fun come from.
Herbstluft WM is unique in way that
the configuration set from command line interface.
So basically the config is just a bunch of
separated herbstclient
command.
It means, the configuration can be bundled using any script
that has access to system command.
One liner is not so bad after all.
Meanwhile
Last couple of months in the real world,
I had a few weeks of badassery.
Now I decide to take time for myself.
Relax, lock myself in my room, doing HersbtluftWM configuration,
get it online,and pour the result in a blog.
I still have to be a little badass outside. I just need to share this HLWM config, before I go back.
I put most relevant code in this tutorial. It matters for me to journal what I did. Although it might not important for most reader. And maybe, small thing I wrote here, important for lest reader, who just in need of this. That is why I need to pour large amount of code in blog.
What is not in this Guidance
No statusbar in this tutorial.
Separate Window Manager Tutorial, and Statusbar Tutorial.
One of the most complex part of Window Manager is Statusbar. It is considered third party. It deserve its own article. And I did wrote a specific article exploring statusbar. After this, we still need two more article.
-
Statusbar, designed specifically for Herbstluft Tag.
-
Putting it all together, Window Manager, StatusBar, Terminals.
Some people don’t even bother with aestethic aspect of Window Manager. No need any statusbar, not even gap between windows. The lesser gap, the more information.
No algorithm. No math. It is just a simple configuration. There is no need to make this complex.
This will only discuss about the HLWM configuration.
Redirect Config
The original Herbsluft WM equipped with one example of
autostart
configuration in BASH .
It is a single long file and plain. We are going to make it modular.
I have seen a sophisticated HLWM config in Perl in a single file.
So why not go further, exercise scripting in few other language.
From BASH, Perl, Python, Ruby, PHP, Lua,
and finally the compiled Haskell.
It is not just possible, we already did write the config.
Every language has their own challenge.
And that is exactly where the fun comes from.
First, we need to redirect to appropriate language script in
~/.config/herbstluftwm/autostart
.
If we want to use BASH, just uncomment the line
containing bash/autostart.sh
.
It is applied to every other language.
Each must have executable permission.
Directory Structure
The idea is Focus
Any WM user would be tempted to alter their WM behaviour.
So give them place in main autostart
.
script, for special customization.
Then a config file for common customization.
A personal startup file. A place for custom code.
Anything in place, anything has their own place.
With these ideas. For each language, script separated into
-
autostart: Main script. The logic flow through here.
-
config: It contain data, most setting here.
-
helper: It contain action procedure. All the code horse work.
-
startup: Everyone has their own startup application, So yeah, separate it, so anyone can freely modify their startup.
-
gmc: Google Material Color. Just a long Color Schemes. Separate it, so it won’t ruin Main script. Since it is a reusable library that can be used for statusbar, i.e dzen2, or lemonbar. It is placed in special directory called assets.
Approach on Tag Names
Instead of common practices, I’m using different approach when it comes to tag status. I’m using number as tag names, and using the number as a key, for use in statusbar, and let the statusbar show display name. It is better this way for me, because the original tag names does not support unicode, e.g Kanji. Meanwhile, I can manage unicode from script based on key number.
Three different things in here
-
Tag names refer to, the name of HLWM’s tags shown in tag_status. The original use only number as tag name. Some smart people in dotshare use string i.e mail, term, to define their tag name. This name usually shown in statusbar.
-
Tag Keys refer to keyboard shortcut. It mostly number 1 to 9. Although you can add 0 (I did). or any keyboard character (I never did).
-
My unique solution, the display name. I prefer to use number as tag names. And let the statusbar manage display name using the tag name number as the key.
Color Schemes Modules
We do not need many colors in Tiling Window Manager. So this color module is not mandatory required. I like google Material Color to create custom Wallpaper in Inkscape. I also use it in Dzen2 Statusbar, or Lemonbar. It is nice to reuse the same resources for Window Manager.
But why do exactly that I have to put it here ?
The reason is testing new data structure
The reason why I put this is Data Structure. Everytime I try new language, I need to test the data structure.
-
It is simple, no need any string interpolation.
-
It is easy to test color, and dump in terminal. Changing color won’t harm system, nor window manager.
After it does proven well, The data structure can be used as a model for herbstluft config. Both are similar, they both use key-value pairs.
Screenshot
Zero Gap, No Panel.
Blog Post
The rest is in their respective article.
Let's get it started.
Dotfiles (Source Code)
Disclaimer
Herbstluft Window Manager.
I do not claim myself as an HLWM expert. In fact, I’m still trying to figure out how to say the word right with german accent.
Thank you for Reading.