What does HackerNews think of hawck?

Key-rebinding daemon for Linux (Wayland/X11/Console)

Language: C++

#10 in Lua
That is actually very smart and helpful, thanks! :) My only gripe with autokey is that it's the only thing holding me back from wayland. Hawck is supposed to work with wayland but I never got it to work, was a while ago I tried though

https://github.com/snyball/Hawck

>Creating a "standardized experience" like Windows usually means that configurability goes right out the window. It's how you get abominations like dconf or the GNOME music player

I don't understand how you connected these dots and I'd suggest against calling things abominations. You don't have to use dconf or the GNOME music player, those aren't standardized. If someone does like them I think they're perfectly fine, they do exactly what they're advertised to do and nothing more than that. It's also fine if you don't like them, they're just two options from the many configuration databases and media players that you can choose from.

>But why shouldn't I be able to run xbindkeys or sxhkd or whatever hotkey dameon I want?

In some ways you actually can but it depends on the hotkey daemon and how it's implemented. The reason for that is technical, those are implemented with X grabs which are an X11-only API and they have a number of usability and security issues. There are a few key rebinding daemons that use evdev directly so they work with both X11 and Wayland, and also on the console:

https://github.com/samvel1024/kbct

https://github.com/snyball/Hawck

But these also do have similar security issues to X key grabs, in that they effectively operate as keyloggers. If you're looking for an API that works purely within Wayland and lets unprivileged clients request key rebinding, that doesn't exist yet. Somebody would need to specify what that API looks like and figure out a good way to make it secure. What would the end goal of the API be, and how could the system (and by extension, the user) tell the difference between a legitimate hotkey daemon and a malicious keylogger? And would it actually be any better than the approach of snooping evdev? I don't know the answer to these questions but you may have more experience with this than I do.

Oh, right. I knew I forgot something.

I use https://github.com/alols/xcape for some while now. It's old, reliable and straight forward, just does it's job. Only downside is that it seems to be limted to X11. Not sure how well it will play with wayland.

There are now also some alternative tools, with more ability, which allow overloading just on the side. I have them on my list for a while now, but not done much yet with them.

- https://github.com/david-janssen/kmonad

- https://github.com/mooz/xkeysnail

- https://github.com/snyball/Hawck

Oh, and for rermapping capslock there are also options with X11. I use

   setxkbmap -option ctrl:nocaps
to map ctrl to capslock, then overload it with

    xcape -e "Control_L=Escape;"
to add ESC ontop.
In GTK2 and 3, you can switch to the emacs key theme and then edit the files in /usr/share/themes/Emacs/ to have meta instead of ctrl. Alternatively, use a key rebinding daemon like https://github.com/snyball/Hawck to rebind the specific keys globally. Long-term I don't think this is worth it though because the programs are not built to support it like they are on a native Cocoa environment. You kind of just have to suck it up and get used to different key bindings in different environments.