this post was submitted on 06 Feb 2025
10 points (100.0% liked)

Linux

50411 readers
1085 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Hello everyone, I am currently trying to set up a kmonad config file to replace the autohotkey script I used on windows. My goal is simply to use the right alt key in combination with a,o,u and so on to type german umlaut characters like ä,ö,ü, etc.

So far I am having trouble even getting kmonad to run the config. I guess I probably misunderstand how this is supposed to work significantly. My initial config file was generated by ChatGPT since I had no idea where to even start.

This is my current config file

(defcfg
  input  (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
  output (uinput-sink "kmonad_keyboard")
  fallthrough true
  allow-cmd true
)

(defsrc
  ralt a o u s lsft
)

(deflayer german
  ralt-a "ä"
  ralt-o "ö"
  ralt-u "ü"
  ralt-s "ß"
  ralt-shift-a "Ä"
  ralt-shift-o "Ö"
  ralt-shift-u "Ü"
)

Any help would be appreciated.

top 7 comments
sorted by: hot top controversial new old
[–] TMP_NKcYUEoM7kXg4qYe@lemmy.world 3 points 2 weeks ago (1 children)

What do you mean you don't know where to start? How about starting by going to their website (github repo). If you did that you would find out about the tutorial. The thing takes like 30 minutes to read. Link: https://github.com/kmonad/kmonad?tab=readme-ov-file#configuration

KMonad does support compose keys but I don't know how to use it. It's described in the tutorial though. You can also just rebind a key or key combination to the keys that would write "ü" on your keyboard. KMonad really just changes what keys are pressed, so if you use a German layout, you will get German characters.

[–] Scrath@lemmy.dbzer0.com 1 points 2 weeks ago (1 children)

I did have a look at their tutorial and found it very technical, difficult to read and was unable to find any information on whether it is possible to send characters/text that are not part of the current keyboard layout. From what you describe I can guess now that kmonad is not really suited to what I am trying to achieve though.

The only way to send characters that are not part of the current layout is to use a compose key sequence. Which you would have to ask about in one of their communication circles. (reddit, etc.) Alternatively you could use command buttons which allow you to execute a command on key press. That way you could use ydotool (https://github.com/ReimuNotMoe/ydotool) to send a sequence to type the umlaut as described on ubuntu wiki (https://wiki.ubuntu.com/ComposeKey#Typing_Macrons.2C_Umlauts.2C_Accents.2C_...) That probably would not need Kmonad when I think about it though. You could just use keybindings of your window manager / desktop environment.

[–] vort3@lemmy.ml 3 points 2 weeks ago (1 children)

Tbh I don't have an answer and this isn't what you're looking for, but have you heard of Compose key? I don't know what is kmomad, but I'm pretty happy with my custom compose sequences.

[–] Scrath@lemmy.dbzer0.com 2 points 2 weeks ago (1 children)

The way I understood the compose key is that it requires me to type a combination in order to get the actual character I want.

What I want is to use the right alt key more like a layer modifier (just like shift works to switch between numbers and signs for example), in order to get my special characters

[–] vort3@lemmy.ml 1 points 2 weeks ago (1 children)

Well you can have 1 letter sequences which is almost what you want. For example have a sequence that consists of single "u" key that composes into "ü" or something similar.

I don't know if it's the same in every DE/Distro, but in KDE I'm pretty sure I can both hold the Compose key and type sequences, or press Compose key once and then type a sequence.

But can't check right now.

[–] Scrath@lemmy.dbzer0.com 2 points 2 weeks ago

That sounds a lot better than what I imagined. I'll have to try that out then. Thanks