
Show HN: Howm – A Vim-like tiling X11 window manager - hunt
https://github.com/HarveyHunt/howm
======
zimbatm
I like that the whole WM is implemented in two files, a .h for configuration
and a .c. The code looks clean and has embedded ascii-art. This looks like a
project made with love.

~~~
hunt
Thank you, this is my first proper C project so I have learnt a lot and have
come a long way. I have really enjoyed working on it and would certainly
describe it as a labour of love.

~~~
johnchristopher
Am I right you did it for the C language first ? It looks like it would have
been easier to implement with Lua in awesome.

Nice job!

------
joaomsa
Really dislike software with configuration baked into the code, every key
binding and experiment requires recompilation which prevents managing it
sanely through a package manager.

I get the appeal of "minimal" in this case, but it just doesn't work for me.

~~~
hunt
I understand that it isn't a nice idea having code and configuration mixed
together and that splitting them would be preferable. However, howm takes less
than 1 second to compile on my laptop, once you have a configuration that you
like you'll rarely change it and I feel that having the configuration in code
makes it easier for hackers to find subtle new ways of customising howm.

A downside that I can see to using a header file for configuration is that a
compile is required for installation and configuration. I don't see this as
being too much of an issue as I don't plan on making howm available as a
binary, so a compiler would be required anyway.

~~~
rakoo
I think we can all agree that once a good setup is found, you don't change it
that much; recompiling is ok as long as it's fast.

The point of GP is that since config.h is part of the standard distribution,
any local modification should be overwritten (or discarded) upon updating the
software, or the user has to maintain a local "fork" with his custom config.h.

You should get inspiration from what suckless does [0]. It uses the same idea
of config through header, and the "solution" is workable for all involved
parties.

[0]
[http://dwm.suckless.org/customisation/](http://dwm.suckless.org/customisation/)

------
Rampoina
I really love vim keybindings and I use them wherever I can (firefox with
vimperator, the shell etc), however I'm not sure that modes make sense on a
window manager. In my opininon it doesn't have that many operations, and they
don't differ that much from each other, I think that having to think which
mode you're on and which one you need to use would only introduce friction and
slow you down (in this case the normal mode is not that normal, i switch
windows as often or more than I create new ones or switch layouts).

Another thing is that the operators, motions, and objects each need its
modifier keys; in my opinion that just misses the point of having modes and
one of the strong points of the vim keybindings. Because of that it was really
hard for me to understand how to use Howm: the first time around I skipped the
configuration part and went directly to the examples, and you don't mention
anywhere there that q4c (for example) is really Alt_L+q, Alt_L+4, Alt_L+c.
When I read the configuration part and the configuration file, to see each
keybinding I got it, but still it took some googling to figure out that I
needed to use xmodmap to know which keys are the MODXMASK.

EDIT: It seems you do mention that the operators, motions and objects need a
modifier key, I missed it. Still, I think that it would be clearer if the keys
to press were explicitly indicated (like Alt_L+q, Alt_L+4, Alt_L+c)

~~~
hunt
I have some more ideas for operations to add, this is the first release I have
done and so it is lacking some features. I agree that some people might not
find certain commands to be in the correct mode. You can change that from the
configuration file though. I certainly take your point on board about moving
being in normal mode and will have a think about whether or not this should be
the default.

That's really great feedback about the documentation, I'll make it more
obvious which modifiers keys need to be held down. Again, you can change the
modifier key used for operators, counts and motions so that howm only uses one
modifier key. This is how I had it for most of howm's development. I changed
to using two modifier keys as I felt that it was nicer to have a logical
separation between the commands and the operators, motions and counts. It also
meant that some keys could be reused but with different modifiers.

~~~
Rampoina
I think they shouldn't use modifiers at all, ideally you would enter the mode
with MODIFIER+modekey and then press the normal keys: q2c. I don't know if
that's possible with your current program but that's what I meant.

~~~
hunt
That is an idea I was considering, I just wasn't sure if people would find it
to get in the way of normal program usage.

It would require more data to be sent backwards and forwards to the X11
server, but that shouldn't be too much of an issue.

~~~
Rampoina
It's a cool project but again I'm not sure what I would gain from the modes,
counts and motions. Right now I use Awesome WM which is really similar to howm
without changing modes, and without using the motions and counts (but I don't
really find myself wanting to use counts to move windows).

------
pweissbrod
One of the reasons I continue development work predominantly in windows OS is
its vast support for mouse-free operability. I love vim for the same reason. I
tried ratpoison in linux but found it to interfere with application keyboard
shortcuts. I also tried AwesomeWM but it wasnt as graceful as the windows key
in windows.

If someone was to solve this issue elegantly it would compel me to reconsider
moving my daily development activities back to linux

~~~
rakoo
Hum... Are we talking about the same Windows ?

Have you tried other tiling window managers ? i3 [0] comes to mind, but XMonad
[1] and Awesome WM [2] are 2 other popular choices in this domain. There are
plenty of others to pick from, too [3].

[0] [http://i3wm.org/](http://i3wm.org/)

[1] [http://xmonad.org/](http://xmonad.org/)

[2] [http://awesome.naquadah.org/](http://awesome.naquadah.org/)

[3]
[https://en.wikipedia.org/wiki/Tiling_window_manager](https://en.wikipedia.org/wiki/Tiling_window_manager)

~~~
pweissbrod
Thats a great list thank you! I never heard of i3wm I promise to read the
docs.

Yes, microsoft windows. I use version 8.1 and while most end users loathe the
interface I've studied the "windows" key and "context menu" key and found it
quite fast to perform all my daily operations (except web browsing) mouse-
free.

My experience with linux is that some programs are great but too many dont
follow standard on very common keyboard operations such as search, tab
navigation, context menu. Also it seems many of these desktop windows managers
such as ratpoison come with default key mappings that conflict with many of my
application's default key mappings which forces me to re-configure.

I invested some time customizing key mappings that would alleviate the issues,
but I have a large stack of actual programming work I need to get to, and
after awhile I just felt like I was trying too hard at it and decided to go
back to the system that works for me. I would like to learn a little more
about developer's mouse-free success with linux, vim, browsers and ides such
as intellij. 2 years back when i researched this it didnt seem like a very
important issue to many people, but to me the little bits of speed gained from
keyboard shortcuts add up into great savings in time and cuts in repetitive
movement and I consider it to be a crucial part of any development system.

~~~
Rampoina
I use awesome WM and I didn't need to customize any of the keyboard shortcuts;
it uses the windows key as the modifier key and as far as I know no other
program uses it.

Also I don't get how the Windows 8.1 window management comes even close to the
2 programs you mentioned (Ratpoison and Awesome WM). With both of those (or
any other tiling manager) you can do much more than just maximize and snap a
window to the sides. (you have virtual workspaces, automatic tiling, better
switching, etc)

~~~
pweissbrod
Maybe I need to invest a little more time into it. I agree with you that the
docking keyboard shortcuts are far less powerful in windows. In practice
however, this limitation doesnt really become an issue for me. Maybe it is
because I have tunnel vision but 2 programs per monitor with a quick means of
switching things around hasnt left me wishing I could have 3,4+ programs per
monitor

~~~
rakoo
I must admit I stopped my knowledge of Windows at Windows 7, which already has
some tiling thingies but nothing even remotely close to the WMs I linked to
earlier.

The thing that is the most visible to me is virtual workspaces. It allows you
to create fixed layouts of programs (editor on the left, terminal to test on
the up-right corner and tail -f of the relevant log on the down-right corner)
grouped within a user-defined context ("code on project1", "code on project2",
"mail", "browser").

The idea is to switch from activity to activity, rather than from application
to application. It's extremely important, because when you start piling up
activities, you accumulate applications, and you don't want to switch through
all of them within your activity.

------
maikklein
Interesting, but you really need to do some showcases.

~~~
hunt
You're completely right- I forgot to upload them and then had no internet
access.

This imgur album has a couple of gifs:
[http://imgur.com/a/8aqD9](http://imgur.com/a/8aqD9)

------
dons
How does this differ from e.g. xmonad, which uses vi-like keybindings? It's
specifically the bulk operators based on movement?

~~~
deweerdt
xmonad isn't modal. This apparently has three modes: 'normal', 'floating' and
'focus'. i3 also has modes: 'normal' and 'resize'.

~~~
tomjakubowski
i3 only has two modes by default. You can create whatever modes in i3 you
like.

    
    
        set $mediamenu "media:  [spc] play/pause [p] prev [n] next"
    
        mode $mediamenu {
            bindsym space exec "playerctl play-pause; i3-msg mode default"
            bindsym p exec "playerctl previous"
            bindsym n exec "playerctl next"
            bindsym Escape mode "default"
            bindsym $mod+m mode "default"
        }
    
        bindsym $mod+m mode $mediamenu
    

Now $mod+m will enter 'media' mode, with its own set of keybindings.

------
cessor
Harvey, your code looks very nice and expressive with appropriate comments.
There is some space for improvements on this matter (well, there always is)
but I found it very good to read and easy to follow!

Really well done, keep up the good work!

~~~
hunt
Thanks for the kind words! It'd be great if you could tell me what
improvements you think would be best, I'm trying to make howm's code as nice
as I can. I know that having everything in one file is frowned upon, but I
quite like the simplicity of it.

------
gpo
This is obviously inspired by dwm, which is cool, but how is it different from
dwm?

~~~
hunt
It's loosely inspired by dwm in that it uses a similar configuration file and
keybinding system.

On a technical level, howm uses xcb- a more modern and efficient X protocol
binding. dwm uses xlib.

From a user's perspective, howm has multiple modes for manipulating different
kinds of windows as well as operators, motions and counts. This means that
multiple windows can have the same operation performed upon them. For example
(assuming that the correct modifier keys are being pressed) pressing "q4w"
will lead to 4 windows being closed.

howm also has some features that dwm only provides as patches, such as useless
gaps and a grid layout.

