How to remap modifier keys in Asahi Gnome?

I did a bunch of looking up hoping to get something basic going: for instance mappiong the left CMD key to CTRL, and the right CMD key to left shift. I understand that Linux and macOS are two very different OSes, I have firm muscle memory for the modifier keymaps I set on macOS and want to ease the transition to linux.

In Input Mapper I tried making an input and output but it said “The device was not grabbed” when I press apply, for the device Apple SPI Keyboard.

I tried keyd where I wrote this in /etc/keyd/default.conf:

[ids]

*

[main]

leftshift = capslock
leftmeta = leftcontrol

I tried sudo systemctl enable keyd --now and nothing happened. This is the output of keyd monitor:

failed to open /dev/input/event5
failed to open /dev/input/event4
failed to open /dev/input/event3
failed to open /dev/input/event2
failed to open /dev/input/event1
failed to open /dev/input/event0

I am not on Asahi, but using Fedora Silverblue and Workstation (so GNOME) on Macs (either bare-metal or VMs), including Mac keyboards. What I did is swap Ctrl with Cmd, in order to have the Mac-specific Cmd+<Letter> key combinations mapped to Ctrl+<Letter>, as used under Linux:

  • Open GNOME Tweaks (install from the repos if not already installed)
  • Navigate to Keyboard → Additional Layouts Options → Ctrl position
  • Check the Swap Left Win with Left Ctrl and Swap Right Win with Right Ctrl boxes.

You might also find other interesting layout options in GNOME Tweaks.

Be informed that these changes are user specific (changes in user’s dconf database).