Apple keyboard swap

Hey:) I'm having a problem with an apple keyboard on my linux machine.

The less then / greater than key is swapped with my "°" key. The less than / greater than key is usually on the right side of shift as it shows on the keyboard.

Do you guys know the solution to this problem?


(There must be perfect keyboard configuration files for your model/layout).

Anyway, The old way:

1 - find those keys:

$ xmodmap -pke | grep -Pw "degree|less" > mychanges

2 - edit "mychanges" to swap the keys. You probably have something like:

keycode 94 = less greater less greater bar brokenbar bar
keycode 49 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032

Swap the keys codes to:

keycode 49 = less greater less greater bar brokenbar bar
keycode 94 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032

3 - activate the changes with

xmodmap mychanges

4 - if your are happy with the new behaviour, do

cat mychanges >> ~/.Xmodmap

This approach can be used to generic keyboard changes (in graphic mode)


Select Apple Keyboard

I know this sounds silly, but there is actually an option in your Settings -> Keyboard that will get rid of this issue. You'll want to select an Apple/Mac keyboard.

Manually 'Select' Apple Keyboard at Boot

I used to use this method, until I realized the above method worked for me.

  • echo "0" > /sys/module/hid_apple/parameters/iso_layout

This will replace the content of the iso_layout file with the value 0