0

I'm on a Norwegian keyboard and use setxkbmap us to code. Sometimes I communicate in Norwegian. This requires me to setxkbmap no. That is rather annoying. I would like to remap the AltGr with another key to output the å character.

I've run xev and å has the byte code c3a5 on key symbol 34, with the name 'aring'. I have remapped it in a keydef file as:

keycode 34 = bracketleft braceleft aring Aring

Then I ran xmodmap ~/keydef. For some reason whenever I press AltGr and ], nothing shows up. What am I doing wrong?

2
  • Map AltGr + [ to 'å' <=!=> whenever I press AltGr and ], nothing shows - isn't this a bit confused? This looks like Linux, but which distro are you running? For Ubuntu: check the Text entry settings in the System Settings - switching keybord setttings should be one way to achieve what you're after.
    – Hannu
    Aug 9, 2015 at 7:15
  • @Hannu: I'm on mint 17. Also I mean for the code point to be inserted instead of actually remapping, upon pressing AltGr + [.
    – user371920
    Aug 9, 2015 at 8:16

1 Answer 1

1

Perhaps you don't have AltGr and Mode_switch on the same modifier, see the output of

xmodmap -pm

However, you might like to read this very useful archlinux page on keyboard configuration. They suggest you would be better off doing, eg:

localectl --no-convert set-x11-keymap us,no pc104 grp:caps_toggle

which creates a permanent setup which shifts between the 2 mappings us and no by pressing the caps lock key. Lots of other toggle keys are available. List them with:

grep "grp:.*toggle" /usr/share/X11/xkb/rules/base.lst

The temporary setxkbmap equivalent is probably (not tested)

setxkbmap us,no pc104 '' grp:caps_toggle

but for those who dont read the comments, this is what finally worked for OP:

setxkbmap -model pc104 -layout us,no -option grp:alt_shift_toggle
2
  • Your answer did not work at all for some reason. I tried with other combinations to no avail. What worked was the following setxkbmap -model pc104 -layout us,no -option grp:alt_shift_toggle. That is the answer. As a tangent: why don't tools consistently use -- for multi-character arguments? gcc and find also torture us with it.
    – user371920
    Aug 9, 2015 at 9:43
  • @BourgondAries glad you persevered. I added your solution to my post in case others dont read far enough.
    – meuh
    Aug 9, 2015 at 9:52

You must log in to answer this question.