Closed Frewacom closed 1 year ago
I attempted to replicate what I implemented in dwl
for dwl-guile
, however I don't really know C programming.
My code changes are captured in a changes.diff file, because I already have an existing dwl fork (GitHub limitation).
dwl-guile
set-tag-keys
binding in defaults.scm
because of its assumptions/conventions that conflict with my typical settings (example below)
C-t 1
for (dwl:view 1)
C-t <rshift> S-1
for (dwl:tag 1)
C-t <rshift> S-1
)C-t [
and C-t ]
for "change-masters" in dwm
or dwl
)Thanks for this project. I tried Guix few days ago and your "home services" projects helped me understand quickly few concepts. I'm hoping switch to dwl-guile on Guix and this issue is the only blocker for me.
Hi, that's very nice to hear!
"Layers" involving the shift key don't appear to work (i.e C-t
S-1)
I think this is because a key sequence can not only consist of a modifier without an actual key. An easy solution would be to just keep track of which "layer" we are currently parsing, and allow sequences without a key for layers > 0.
I didn't attempt to solve parsing issues for the validation of the "[" character (i.e. I typically have C-t [ and C-t ] for "change-masters" in dwm or dwl)
As you may have seen, I decided to use [
and ]
for allowing users to use custom keycodes in their key sequences (e.g. C-[123]
), which is why it can not be used in a key sequence directly. I guess we should change the delimiter for this to a key that is not used, or perhaps something like C-[[123]]
.
I'll have a look at adding these changes to the main branch, hopefully sometime this weekend. Thanks!
I have integrated the keychord patch into the main branch, so feel free to have a look and check if everything works as expected @yveszoundi. The issue with parsing [
has been fixed by simply checking if it is followed by another non-null character (and if it is, it will be parsed as a custom keycode instead).
~As for your issue with left and right shift, changing the keycode for <lshift>
to 42 and <rshift>
to 54 makes it work just fine for me (see https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h).~ Nevermind, it does not work.
Thanks a lot, this is much appreciated. I'll start playing with it and I'll report back soon.
By the way, I did manage to do it myself, (the "quick and dirty way"), with some limitations:
keycodes.h
to simplify parsing without "-" tokens: mouse-middle
-> mousemiddle
It looks good to me @Frewacom, great work.
left-shift
and right-shift
and everything behaves as expectedC-t x o
vs. C-t C-x o
I can now switch to dwl-guile
on all my virtual machines, including those where I don't run Guix: I just apply the autostart patch to easily launch programs such as dtao-guile
and wlr-randr
from $XDG_DATA_HOME/dwl-guile/autostart.sh
.
Nice!
I am not entirely familiar with the autostart patch, but it is also possible to do something like this via Guile by adding a function to the startup hook (you can check the man page or dscm/init.scm on how to add it).
Because the home-dwl-guile-service-type
is very flexible, I previously wrapped my own build within a (package ...)
block in the configuration (for guix).
I have now transitioned to a startup hook which is much better. Thanks!
Config syntax could look like:
where each "layer" is separated by a space, just like in Emacs.
Patch can be found here: https://github.com/djpohly/dwl/wiki/keychord