In theory I’ve been resting in bed with COVID these last days, but it’s hard for
me to sit my entirely idle, so I wrote a invested some of this time in
familiarising myself with hare-wayland
and hare-ev
.
wlhc
is a small program to enable “hot corners” on wayland desktops. It
takes a corner and a command as argument. When the mouse (or touchpad) pointer
hits that corner of the screen, wlhc
executes the provided command.
The implementation uses the wlr-layer-shell
protocol to detect when the mouse
hits a corner. This is a bit of an abuse of this protocol (i.e.: it’s not really
designed for this), but it works.
The whole project is available at https://git.sr.ht/~whynothugo/wlhc and released under the ISC licence. The README contains all the documentation.
Right now there’s only one annoyance: the Makefile
hard-codes paths to the
wayland protocol files. I think most distributions ship these in the same
location, but the build script may require tinkering on distributions with
unusual filesystem layouts.
Working on a small project like this in Hare has been a pleasure. Hare doesn’t add any layers over the underlying abstractions, so it’s always quite straightforward to understand what’s going on. The dopamine hits of completing little milestones while advancing on this project have been invaluable in my current state of health.
The main downside of Hare right now is that the ecosystem is still immature, and
I had to apply patches (now merged upstream) to both dependencies in order for
them to build with the latest compiler. I’ll wait for these to trickle down into
stable releases before tagging a release of wlhc
itself.