0

I'm using Ubuntu 20.04.4 LTS with GNOME 3.36.8, and I just switched from Windows to the Linux multiverse. My laptop keyboard has the following keys to the left and to the right of the Spacebar:

Ctrl Win Alt Spacebar AltGr PrtSc Ctrl

and I'd like to achieve the following remapping:

AltGr Alt Ctrl Spacebar Ctrl Alt AltGr

while mapping Win to CapsLock. The reason is that I use Emacs a lot, and also type in languages with many diacritics.

More precisely:

  • By AltGr I mean the modifier key that gives characters with diacritics in some keyboards, such as "à". Possibly it corresponds to the mod5 modifier, but I'm not sure about this.
  • By Win I mean the key that often activates special functions at the windows-manager level, for example opening Activities, or moving windows to another workspace. I think it's associated with the Super key, but again I'm not sure.

Also: if possible I'd like to keep these remappings even if I change my keyboard layout, say from Dvorak to Qwerty. But if this is not possible, I'm happy modifying a layout.

To achieve these remappings I first tried the GNOME Tweaks tool, but it does not allow me to do all of them, only some. On top of that, I notice that the windows manager somehow interferes with the Win key, which in some cases still opens the Activities screen, even if theoretically it should have been remapped.

I was also trying to use xmodmap, but some recent sites say that it's an obsolete way and I should use setxkbmap instead (is that true?).

I checked several questions and answers on Stack Exchange, but most of them seem to be quite outdated. I'd appreciate some instructions or a reference to an understandable and updated tutorial. Thank you!

pglpm
  • 149
  • 1
    Editing the xkb keyboard layout files, but it is rather complicated. – vanadium Jun 03 '22 at 11:08
  • 5
    The best way in 2022 in for 20.04 is the best way it was in 2020, nothing significant has changed in 20.04 since it was released. That something seems "outdated" to you doesn't mean it is. Please link to the posts on Ask Ubuntu that you have tried and didn't work on 20.04, with what you actually tried and the actual errors you got. – muru Jun 06 '22 at 13:44
  • "Outdated and not tried" is equal to "not tested/tried" and the 'outdated' is irrelevant. Have you actually tested/tried those "outdated" posts? Keep in mind anything circa 2020 is not "outdated" if you're using 20.04, and even 'old' posts from 2018 or such can still be valid ways to do things in modern Ubuntu. – Thomas Ward Jun 06 '22 at 19:30
  • 1
    @pglpm I do agree with Muru's comments on Meta that it would probably be best for you to post your answer on one of the other questions here. Either that, or (as I mentioned in my Meta answer) you should edit your question to show why it is different enough from the existing questions. Is this question a good candidate? – NotTheDr01ds Jun 06 '22 at 22:20
  • "But I don't yield to bullying" - I don't see 'bullying' here, what I see is that your post was closed as opinion-based - that isn't bullying that's part of the process of the site. As it currently stands, I can reopen it, however you do have to be careful with the wording if you ask "What is the best" that's different than "How do I?" which is a different question. Best is subjective and will lead to opinions rather than actual answers where you can pick one. Keep in mind the way you ask the question as well - that's going to lead to context for whether you can answer or not. – Thomas Ward Jun 07 '22 at 16:25
  • 2
    However, at no point do I see "bullying" anywhere, and if you believe that you're being bullied simply because your post was closed under the policies of the site, then you should be taking that to Meta for arguing, not calling people out here or calling people bullies (especially when it's normal for posts that ask "What's the best" to be closed as opinion based). – Thomas Ward Jun 07 '22 at 16:26
  • Thank you all moderators for reopening this question. I managed to find a solution and will post it as an answer - I hope it may be useful to other people. – pglpm Jun 08 '22 at 12:36
  • @ThomasWard I opened a question on meta about "What's the best". Would a question like "What's the optimal way...?" be opinion-based? And an "How do I...?" question may have different solutions, and people will obviously answer with the solution that is best in their opinion. That something is 'normal' does not mean that it's right (since we're splitting hairs about words). In a country it may be 'normal' to beat people walking on the street, and yet I don't see how that could be acceptable. – pglpm Jun 08 '22 at 12:46

0 Answers0