Skip to content

Instantly share code, notes, and snippets.

@stigok
Last active April 15, 2022 18:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stigok/2aabc44c3a151fc3d3fed119f2c1f44f to your computer and use it in GitHub Desktop.
Save stigok/2aabc44c3a151fc3d3fed119f2c1f44f to your computer and use it in GitHub Desktop.
Norwegian characters on US keyboard layout with Caps Lock as modifier key (.Xmodmap). See comments for usage instructions.
clear lock
!Maps Caps-Lock as Level3 Shift
keycode 66 = Mode_switch ISO_Level3_Shift
!Norwegian alpha chars ÆØÅ
keycode 47 = semicolon colon oslash Oslash
keycode 48 = apostrophe quotedbl ae AE
keycode 34 = bracketleft braceleft aring Aring

Usage

Place the .Xmodmap in your home directory, then run xmodmap ~/.Xmodmap to test the configuration. For a persistent setup, load the file inside ~/.xinitrc:

usermodmap=$HOME/.Xmodmap

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

Bindings

  • Caps-Lock + \ = æ
  • Caps-Lock + ; = ø
  • Caps-Lock + [ = å
  • Caps-Lock + Shift + ; = Æ
  • Caps-Lock + Shift + ; = Ø
  • Caps-Lock + Shift + [ = Å
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment