Possible to make the Linux modifier keys Mac-like?

iljitsch

Ars Tribunus Angusticlavius
8,530
Subscriptor++
I’ve complained about this before on these forums: one thing that keeps me from adopting Linux on the desktop is that under Linux, keyboards are handled more or less like under Windows. While I spent about three decades of my life with Amigas and Macs, which approach the keyboard in a different way. There, these modifier keys do the following things:

  • generic name: meta. On the Mac this is "command’", on the Amiga there are two Amiga keys. You use the/a meta key with a letter for various OS shortcuts, well-known application shortcuts, and sometimes application-specific shortcuts. So meta-Z is undo, meta-shift-Z is redo, meta-C is copy, meta-V is paste, meta-Q is quit application, meta-P is print, meta-Y is browse history in Safari.
  • alt, (also) named "option" on the Mac and similar to AltGr with some Windows keyboard layouts: to type additional characters and accented letters.
  • control: for typing the ASCII control characters, like on a Unix/Linux command line.
  • shift: duh.

So the idea is that you never use alt or control key combinations (without the meta key) to perform actions such as alt-tab to switch between apps (that would be command-tab) or ^C for copy (that would be command-C).

There are of course many additional subtleties, but let’s not go into the weeds just yet.

My question: what would it take to change the keyboard logic under Linux so that on a Linux desktop, the keyboard works like it does on the Mac?

A good start would be just to be able to create my own keyboard layout to type accented characters using the alt key. I came up with a system to define those keyboard layouts in JSON and then export them to Mac or Windows (with some effort) layouts. No idea how to do that for Linux, though. And it looks like I can’t type any non-7-bit-ASCII characters on my Raspberry Pi 400... Alt really doesn’t do anything on that machine.
 

koala

Ars Tribunus Angusticlavius
7,598
IMHO, it's not possible to do it well. You'd have to remap individual apps (e.g. most apps on Linux have ctrl+c as copy, but Gnome Terminal has it on ctrl+shift+c. If you want to remap it to meta+c, you'll have to have per-app customizations. As far as I know, there's really no high level "copy" operation that you can remap across the board.)

As for accents, if you are targetting a small number of languages, you can probably get a keyboard layout that works (IIRC, the Spanish layout can do Catalan, French, possibly more. I think the German keyboard can do a few languages too). If you really want to be able to type a lot of characters, probably coming from many different languages, learn how to use the compose key- that's widely supported, available consistently on most OSes, etc.
 

iljitsch

Ars Tribunus Angusticlavius
8,530
Subscriptor++
As for accents, if you are targetting a small number of languages, you can probably get a keyboard layout that works (IIRC, the Spanish layout can do Catalan, French, possibly more. I think the German keyboard can do a few languages too). If you really want to be able to type a lot of characters, probably coming from many different languages, learn how to use the compose key- that's widely supported, available consistently on most OSes, etc.
Yeah, that's not what I want.

I designed a completely new layer 3 and 4 keyboard layout (= keys combined with alt (3) and alt+shift (4)) for typing accents and additional characters that I can use easily on the Mac and with a bit more effort on Windows. What I want is to have the exact same thing on Linux, not something else that accomplishes the same result in a different way.
 

rppp01

Ars Scholae Palatinae
1,028
Oh hey maybe I can help here.
I've run into the same problem. I am more comfortable with mac keyboard shortcuts and I find they do not interrupt things like 'command c' when I am working in the command line.

I run wayland and KDE.
After trying to change every default keystoke from KDE to Konsole to Firefox to whatever, I found an app on github that does it for you.

Toshy

I had to change all my mappings back to default and then install this. It instantly fixed 90% of my issues. I've still one where I want to use Alt - right key to move to the virtual desktop to the right and Alt - left key to do the same to the left. The 'super' key is now control. But now I can copy / paste files between programs and the command line using alt-c alt-v. I can open new tabs with alt-t.

Give it a shot.
 
  • Like
Reactions: continuum