this post was submitted on 16 Jan 2024
34 points (100.0% liked)

Linux

48372 readers
1228 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
 

EDIT: Solved! Check this comment!

I use a keyboard with an american layout. I find it much better for coding and actually love this keyboard to pieces. However, I still need to write in portuguese.

The dead keys in Microsoft Windows worked perfectly for me but the Linux ones do not. Some characters are not available and are replaced by characters that don't exist in the portuguese language.

In X11 I fixed this by using an .XCompose file with the keybinds just like in Windows. Source here, it works perfectly.

In Wayland, the .XCompose file works for pretty much all apps. Firefox is fine, kitty is fine, Vivaldi is fine. Unfortunately electron apps with the --ozone-platform-hint=wayland ignores the .XCompose file and I get the default keybinds. Since I own an nvidia card I really need these flags, otherwise the electron apps will aggressively flicker and/or eat letters while I'm typing.

I've searched far and wide, there are several open bugs in chromium, electron and wayland repositories. Everyone seems to be pointing fingers at each other for years and no workaround to make .XCompose work seems to be available.

I'm wondering if there is an alternative way to customize the dead keys under Wayland. Thanks in advance.

you are viewing a single comment's thread
view the rest of the comments
[–] jntesteves 6 points 10 months ago* (last edited 10 months ago) (1 children)

I'm using GNOME Wayland on Fedora 39 and I don't have the problem you describe. I just go to settings and select my keyboard layouts:

  • English (US, intl., with dead keys)
  • English (intl., with AltGr dead keys)

And everything just works. I specially like the second one because it doesn't interfere with keybindings in games, which can be a problem in GNOME Wayland.

Oh, I think I get the issue you're having, you can't find the Çç character on the Linux layout 😅 I always have to explain this to people migrating from Windows, it's AltGr+, (right Alt key plus Comma). I like this shortcut better than the Windows layout, but I understand some people might not like it. Unfortunately, I can't answer your question, as I too don't know how to customize the keyboard layout. I just got used to the Linux layout.

[–] pathief 5 points 10 months ago* (last edited 10 months ago) (1 children)

Yes, I'm using the US international with dead keys layout. I also used it in Microsoft Windows. Here's a couple of annoying examples:

  • ' + c-> result: ć; expectation: ç
  • ' + m -> result: ḿ; expectation: 'm (particularly annoying when typing in english; workaround: ' + space key + m)
  • ' + t -> result: nothing happens; expectation: 't (particularly annoying when typing in english; workaround: ' + space key + t)

Right Alt + Comma does work for ç so at least I have that going for me. It's still weird to have a different layout for electron apps :/

[–] jntesteves 4 points 10 months ago* (last edited 10 months ago) (1 children)

You should be able to type ç the way I described for all apps, so you could just remove your custom layout. I highly recommend the English (intl., with AltGr dead keys) layout, it's perfect for coding and writing in English. It's a bit more work to write in Portuguese, though, so it took me a while to get used to it, but it's worth it if coding is what you're doing most of the time. In this layout, you must hold AltGr to get the dead keys, otherwise it's a normal English layout.

You can also use two layouts — one for English/coding, one for Portuguese — and the keyboard shortcut Super+Space to switch between them. I always have two layouts setup like this, but I never switch anymore because I just learned to love the English (intl., with AltGr dead keys) layout — and I don't write much Portuguese nowadays.

[–] pathief 2 points 10 months ago

Thank you! It's not exactly what I wanted but at this point I'm just happy to have a solid workaround to my problem that works everywhere.