This patch modifies the Norwegian Macintosh keyboard layout on Ubuntu as follows:
'(apostrophe) to the unshifted position on the'§key to match the physical label$to the Shift position and€to AltGR position of the4key to match the physical label¤to Shift+AltGr on the4key (since this is hardly used these days)- Reverse the ````` and
´order to match the physical label Alt [Right]set toAltGr
Tested on Ubuntu 24.04 under GNOME Wayland on a "MacBookPro11,1" model from 2013, with a built in Norwegian (labelled) keyboard.
- Save the following as
mac_keyboard_tweaks.patch:
--- a/usr/share/X11/xkb/symbols/no
+++ b/usr/share/X11/xkb/symbols/no
@@ -190,15 +190,15 @@
name[Group1]= "Norwegian (Macintosh)";
- key <TLDE> { [ bar, section ] };
+ key <TLDE> { [ apostrophe, section ] };
key <AE03> { [ 3, numbersign, sterling, sterling ] };
- key <AE04> { [ 4, currency, dollar, dollar ] };
+ key <AE04> { [ 4, dollar, EuroSign, currency ] };
key <AE06> { [ 6, ampersand, threequarters, fiveeighths ] };
key <AE07> { [ 7, slash, bar, backslash ] };
key <AE08> { [ 8, parenleft, bracketleft, braceleft ] };
key <AE09> { [ 9, parenright, bracketright, braceright ] };
key <AE11> { [ plus, question ] };
- key <AE12> { [dead_grave, dead_acute, acute, dead_ogonek ] };
+ key <AE12> { [dead_acute, dead_grave, acute, dead_ogonek ] };
key <AD11> { [ aring, Aring ] };
key <AD12> { [ diaeresis, asciicircum, asciitilde, dead_macron ] };
@@ -206,6 +206,8 @@
key <AC10> { [ oslash, Oslash, odiaeresis, Odiaeresis ] };
key <AC11> { [ ae, AE ] };
key <BKSL> { [ at, asterisk ] };
+
+ include "level3(ralt_switch)"
};
partial alphanumeric_keys- Apply the patch:
sudo patch /usr/share/X11/xkb/symbols/no < mac_keyboard_tweaks.patch- Set the layout:
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'no+mac')]"Note: You might need to restart Gnome for the change to apply if you had already set this layout before patching.