You are not logged in.
I am using two keyboard layouts - us,sk.
I wanted to modify a key to work as another super key. And so I did as described in Arch Linux XKB Wiki - Editing layouts.
Before I started using my custom keymap, keyboard layout on my polybar was showing as either "us" or "sk".
When using my custom keymap, layout switching works, but polybar reports either "pc_us_sk" when the current layout is us, or nothing when the current layout is sk.
Any idea how to fix this so it shows "us" or "sk" just like before?
I am using bspwm, that should not matter, but it was suggested to me that I should mention it.
Thank you.
Command used to load custom keymap located in .xprofile:
test -f ~/.config/.Xkeymap && xkbcomp ~/.config/.Xkeymap $DISPLAY~/.config/.Xkeymap:
See on Pastebin.
Last edited by Filip62 (2020-10-29 22:04:17)
Offline
It looks like line 1181 is probably the relevant line here...
xkb_symbols "pc+us+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)" {Offline
It looks like line 1181 is probably the relevant line here...
xkb_symbols "pc+us+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)" {
I thought I should not change that at first, but when I tried I found out it really is the value that gets displayed as my layout on polybar.
So I changed it, but it does not matter what I put there I always does the same thing:
Added '(' before pc - does not display anything.
xkb_symbols "(pc+us+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)" {Added '(' after pc+u - shows pc_u - the '+' symbol always gets substituted for '_', even when I add other '+' symbols.
xkb_symbols "pc+u(s+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)" {So what I learned is just that '+' gets substituted for '_' and the layout is anything between the starting " and the first (
I do not have a clue how to tell it the name of the second layout.
Offline
It looks like if you set a keymap with setxkbmap, the keymap name is shown correctly, but if you export it and reupload the same file with xkbcomp, the keymap names break.
However, changing the configuration by piping setxkbmap -print to xkbcomp seems to work fine as far as keymap names go.
Since the output of setxkbmap -print is formatted as
$ setxkbmap -layout us,sk -print
...
xkb_symbols { include "pc+us+sk:2+inet(evdev)" };
...try changing
xkb_symbols "pc+us+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)" {to
xkb_symbols {
include "pc+us+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)"Last edited by FaeFeyFa (2020-10-26 22:41:05)
Offline
try changing
xkb_symbols "pc+us+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)" {to
xkb_symbols { include "pc+us+sk(qwerty):2+inet(evdev)+group(shifts_toggle)+terminate(ctrl_alt_bksp)"
That worked perfectly. Thank you very much.
Could you please explain why does that work and what does the include statement do differently that the one without include and how did you figure out that this would work.
Thanks again.
Offline
I found this solution through trial-and-error. ![]()
I noticed that, if you have working keymap names created through setxkbmap, using xkbcomp to get the current configuration and then running xkbcomp again with the same configuration
$ xkbcomp $DISPLAY ~/.config/Xkeymap
$ xkbcomp ~/.config/Xkeymap $DISPLAYwould break the names.
However, running
$ setxkbmap -layout us,sk -print | xkbcomp - $DISPLAYworked.
Since setxkbmap -print used "include", unlike the config file generated by xkbcomp, I tried changing that, and it worked.
Offline