/r/Kmonad
More information to come.
Kmonad The Onion of Keyboard Management Tools, available on GNU/Linux, Windows, and MacOS!
Kmonad-Contrib is the current repository for shared configs. We only want to help onboard users and provide more resources to Kmonad.
More information to come.
Kmonad The Onion of Keyboard Management Tools, available on GNU/Linux, Windows, and MacOS!
Kmonad-Contrib is the current repository for shared configs. We only want to help onboard users and provide more resources to Kmonad.
/r/Kmonad
Hi, after hunting for an option to rebind my capslock key to esc when tapping and caps when holding, I ended up with kmonad. I'm also not very experienced with linux in general, as i installed Fedora 40 + KDE just about a week ago, so please bear with me.
I tried to configure kmonad's defsrc with the example provided in the docs but didnt manage to get it working together with the deflayer base, as i got an error with different amounts of keys in both of them.
so i deleted most of the keys in the defsrc, as i technically dont need them to be remapped. Is this wrong?
I can now execute the config.kbd file without errors but it doesnt work.
Any help would be much appreachiated.
my config file:
(defcfg
input (device-file "/dev/input/by-path/pci-0000:00:14.0-usb-0:5.2.2:1.1-event-kbd")
output (uinput-sink "kmonad-output")
fallthrough true ;; Allows unhandled keys to pass through
allow-cmd false
)
(defsrc
esc
caps
)
(deflayer base
;; Tap for Escape, Hold for Caps Lock
caps (tap-hold 200 esc caps)
)
If this is of any relevance, I'm using a german qwertz keyboard layout called neoqwertz, where the capslock key works as a modifier key. As the keyboad layout does the remapping itself it just need to bind the caps key to "caps lock", so this shouldnt cause trouble.
Hi everyone! I have this setup on my Keychron K8 pro which I have achieved using QMK:
I have 3 layers:
The way I access the second layer is to hold the spacebar, while the spacebar is held if I tap z it switches to the third layer while still holding the space bar, if I tap z again it switches back to the second layer. If at any point while on the second or the third layer I let go the space bar I go back to the qwerty base layer.
Like it or not this is what I've been using it for a while and I find it very comfortable to use all the keys I need while only using the letter keys and the space bar.
I tried to recreate this on kmonad and this is the .kbd file I came up with:
(defcfg
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "My KMonad output")
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ssrq slck pause
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
tab q w e r t y u i o p [ ] \ del end pgdn kp7 kp8 kp9 kp+
caps a s d f g h j k l ; ' ret kp4 kp5 kp6
lsft z x c v b n m , . / rsft up kp1 kp2 kp3 kprt
lctl lmet lalt spc ralt rmet cmp rctl left down rght kp0 kp.
)
(defalias
alt_a (tap-hold-next-release 250 a lalt)
met_s (tap-hold-next-release 250 s lmet)
ctl_d (tap-hold-next-release 250 d lctl)
sft_f (tap-hold-next-release 250 f lsft)
sft_j (tap-hold-next-release 250 j rsft)
ctl_k (tap-hold-next-release 250 k rctl)
met_l (tap-hold-next-release 250 l rmet)
alt_; (tap-hold-next-release 250 ; lalt)
space_layer (tap-hold-next-release 250 spc (layer-toggle extra))
t_z1 (layer-add numbers)
t_z2 (layer-rem numbers)
clear (around (layer-rem extra) (layer-rem numbers))
tilda (around lsft grv)
btab (around lsft tab)
pip (around lsft \ )
)
(deflayer qwerty
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ssrq slck pause
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
tab q w e r t y u i o p [ ] \ del end pgdn kp7 kp8 kp9 kp+
caps @alt_a @met_s @ctl_d @sft_f g h @sft_j @ctl_k @met_l @alt_; ' ret kp4 kp5 kp6
lsft z x c v b n m , . / rsft up kp1 kp2 kp3 kprt
lctl lmet lalt @space_layer ralt rmet cmp rctl left down rght kp0 kp.
)
(deflayer extra
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ssrq slck pause
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
tab esc grv @tilda tab @btab y u @pip \ bspc [ ] \ del end pgdn kp7 kp8 kp9 kp+
caps lalt lmet lctl lsft g left down up right ret ' ret kp4 kp5 kp6
lsft @t_z1 x c v b n m , . / rsft up kp1 kp2 kp3 kprt
lctl lmet lalt (layer-rem extra) ralt rmet cmp rctl left down rght kp0 kp.
)
(deflayer numbers
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ssrq slck pause
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
tab 1 2 3 4 5 6 7 8 9 0 [ ] \ del end pgdn kp7 kp8 kp9 kp+
caps ! @ # $ % ^ & * \( \) ' ret kp4 kp5 kp6
lsft @t_z2 x c v b n m , . / rsft up kp1 kp2 kp3 kprt
lctl lmet lalt @clear ralt rmet cmp rctl left down rght kp0 kp.
)
The layers are just as I want them, the issue is that the release of the space bar doesn't work when on the numbers layer, if I release it I stay on the numbers layer, only when I press it I can go back to the base layer. If I release the spacebar while on the second layer it does go back to the qwerty base layer, just as needed.
I could achieve this behaviour on QMK by creating a custom key for the spacebar on the extra and numbers layer which triggers on release and clears all layers and modifiers. But it seems to me that this is not possible in kmonad, is there another way to achieve the same result?
In my mouse layer, I'd like to use one button to press control & shift together while dragging my mouse.
around, sticky keys, and tap macros don't work. C-S- works only for a subsequent keypress, but not for holding ctrl+shift during mouse movement.
Hi, I just started configuring and trying out KMonad, I daily an alternative layout (Halmak) but whenever I hold down modifiers such as Ctrl, Alt, or Win-Key, the layout detects Qwerty
Ex: If i want to copy something, I press the usual Ctrl+C combination key, even though in Halmak that is Ctrl+V
I'm wondering how to do this kind of configuration in KMonad, can anyone help? TIA
Is there a way to organise a kmonad configuration into separate files which are included in a main configuration file?
As said. Really appreciate it!
So my usecase is I want to assign two keyboard shortcuts to single key, because both starts with f. That way it is easy for me to bind them to the key f.
For example : I dont want to achieve ctrl+a on a single button, I want to achieve ctrl+a when single tap on a button and then same button when tapped twice does ctrl+x.
Now I accept that may be there is a way to do it, it might be the case that I just dont know how to implement it to get my desired outcome.
So, community people, can you please suggest me how to bind two different shortcut combination to a single key.
basically title. I want my colemak dh to work while im signing and first starting the laptop for the day. Can kmonad do this? Thank you
(im on debian 12 if that changes anything)
I installed Kmonad. I'm on macOS on an M-series chip. I see the the Kmonad folder I installed in my home directory.
I looked around everywhere and tried a bunch of stuff, but literally how to I just run the program just using /keymap/tutorial.kbd?? The files in Kmonad/startup are some Linux Ini files or something and don't seem to be related to macOS.
Any help is appreciated.
I've been using kmonad these last 6 months already. I can't live without it for home row mods on my 60% mechanical keyboard (where I cannot modify the firmware). Thank you!
My main pain point was when switching from wired to bluetooth or the other way round. I finally found a way to have something reliable, but it's convoluted.
It might help you if you want have hotplug under Linux and kmonad always activated:
There is any way to get a key working as dead key with Kmonad?
Like I tap "dead_grave" key than I tap "e" key and I get "è"?
Hello,
Can i use Kmonad to remap the mouse scroll wheel on my Razer Tartarus? Its a keybad that includes a mouse-scroll wheel.
Thank you.
I use Mac for office and Linux for personal use. And I want to use kmonad to remap my Linux keyboard to function like a Mac.
I am relatively new to kmonad. And am able to remap the ctrl key. But wanted some help mapping the other functions like SIGINT (command + c).
First: Thank you for Kmonad. I used input-remapper in the past, but kmonad is more flexible.
I thought I am smart, and I use the CapsLock key for a new layer.
I am mostly interested in navigation like (pos1, end, del, up/down, pageUp/Down).
Now I realized that I need to move my pinkie finger to the side if I use CapsLock.
... why not create a new layer by pressing (and holding) "a"?
Then my pinkie finger does not need to move.
Of course, just pressing "a" should still be possible.
Which config is needed to create an "on hold layer"?
Example: holding A and pressing J should be like backspace. But of course, just pressing A should emit "a".
I don't need the default of keyboards: If I hold "a" then it gets emitted again and again. If I want to write "a" ten times, I can press "a" ten times. A new layer would give me much more features.
I just set up Kmonad and everything behaves as I would expect except the screen locker. When I lock my screen with slock and Kmonad running I am unable to enter my password. I use the colemak layout and have tried to enter the password as if I am on qwerty, but neither works. I also experienced the exact same issue with i3lock. Is this a common issue and how would I solve it?
P.S. I am on Void Linux btw.
I switched from input-remapper to Kmonad.
Thank you for this great tool!
I published my config here:
https://github.com/guettli/ten-flying-fingers
Feedback is welcome.
I'm just starting with kmonad on linux (opensuse), and I've gotten through the basics OK: settings the input device, scr, default layer and so on.
One thing I can't seem to do is grab inputs from any additional media keys, like volume controls, search, calculator etc.
These are detected by xev as eg XF86AudioRaiseVolume, XF86Search, XF86Calculator, but they aren't grabbed by evtest, and entering the codes that seem relevant such as KeyVolumeUp or volu from https://github.com/kmonad/kmonad/blob/master/src/KMonad/Keyboard/Keycode.hs doesn't fly.
Do these keys occur at different level that kmonad can't see, or have i missed something obvious?
When I use home row mods using QMK, holding the key down when pressed the second time starts repeating the key. How can I achieve the same with kmonad. Current behaviour only lacks the repeat part. Rest works as expected.
I was having issues with my keyboard while using kmonad. My keyboard has a rotary dial on it which I want to use in macros and layers, however under /dev/input/by-id it is listed as a seperate "mouse" device rather than being attached to the keyboard event. I found a program on github (mergeinputs) which fixes this issue. It takes multiple input device events and combine it into a single one which can then be used in kmonad. One problem I saw with the program is that although it created the new event, it gave it a dynamic id (eventX) which made it unintuitive for kmonad which reads from a input file that is static. I forked the program so that it will create a symlink to a user defined path so that you can simply run the program and the kmonad configuration should work every time. This program can combine any input device together so you can technically combine separate keyboards for kmonad macros as well. You can find my fork here.
To use, simple clone, run make install
, and run mergeinputs /path/to/store/symlink /dev/input/by-id/usb-KEYBOARD_NAME-* &
from either a start-up script or implement the systemd service.
You can use a wildcard or name inputs individually or you can even use /dev/input/by-id/* to use all keyboards.
Thought I would share this to potentially help anyone who might run into the same issue.
Using two keyboards kmonad linux, using multiple keyboards, combine multiple inputs, combine input devices, separate keyboards
Edit: Add tags for SEO
Hi, I've been using kmonad for about 2 months and absolutely love it. The FINAL thing I'm looking to achieve with it is being able to create a layer that will run/ raises specific apps depending on whether they are open or not. After a bit of research, I found jumpapp, which does exactly what I want it to. I.e. I can type "jumpapp firefox-developer-edition" in the terminal and it will open a new instance if there is none already open, and jump to that window if one already going ( if there are multiple instances then you can jump between them too).
HOWEVER, as soon as I try to invoke it it is part of my kmonad config, I get a message in the terminal stating that it's running - but nothing happens. I'm wondering whether there is a permissions issue that I'm not aware of or something similar. Does anyone have any ideas?
An example of a line used to run an app in my kmonad config is:
brow (cmd-button "jumpapp firefox-developer-edition")
I then call the brow alias in a layer with the standard \@brow
If relevant, I'm on Arch linux. Please let me know if there is anything else I can share. Any help massively appreciated!
I'm using a 60% US keyboard layout in a UK environment and it outputs the ¬
on Shift-Grave Accent
, ie the first key on the top row and I want to switch that to |
.
Key | Current | New |
---|---|---|
` | ` | ` |
Shift | ¬ | \ |
Left-Alt | intercepted by EXWM/Emacs | leave alone would like vertical slash though |
Ctrl | nothing | vertical slash |
Currently Right Alt -
produces the \
slash key. If it is to remain that way then Shift-Alt -
should produce |
Any quick KMonad configuration for this?
This my first foray into KMonad.
I'm trying to create defaliases for entering ASCII Alt key combos in Windows, can't figure out how.
For instance, holding Alt and pressing 0176 on the numpad, inputs the "degree" character ° - to get an alias for this, so I can remap it to a key - I thought of:
(around lalt (around nlck (tap-macro 0 1 7 6)))
However, that doesn't work. This seems to me because it should be without the nlck - as that only toggles and untoggles numlock - and instead using something like KeyNumpad0 KeyNumpad1 etc - but there are no such keys.
There should be numpad key definitions though, right - as these are different from regular numbers?
Is this doable for Windows?
Is there a good way to read the inputs that Kmonad sees by typing. The first issue I'm having is that Kmonad doesn't seem to want to remap the Calc button on my separate numpad. All the other remappings work on that device. I've tried different variations of StartApp2, LaunchApplication2, Calc, etc. And none of them seem to work.
The second reason I'm wondering about this is because I was hoping to remap the buttons on my Logitech G604 mouse. But I have no idea what they are even mapped to by default.
Edit: I think I found a solution for the mouse by mapping the keys to the onboard mouse memory in Windows using Logitech software. Haven't tested it yet, but still looking for solutions for the Calc key on the numpad.
I started using Kmonad and I love it. I want to use it both at home and at the office. But the laptop I use at the office is different. How do I have my config shared between two keyboards without having to go edit the config file each time?
Note: the config itself isn't a problem, it's compatible for both, it's just the input device id that's different.
Searched around and couldn't find anything. Just wondering if anyone has actual numbers on added latency while using kmonad.
When trying to run Kmonad (even with the most basic config, where the single layer is same as the defsrc), it doesnt run completely, and printing the log shows that it gets stuck on
Launching Process: emitter_proc
https://sokinpui.github.io/Blog/post/kmonad-introduction/
Hope this blog can help someone, please issue me if any improvement is great.