Keyboard layout settings no longer works after using setxkbmap command and adding / removing layouts

carelessly used setxkbmap -layout us -print and i think that is why my system is locked into the strait US variant of the keyboard layouts and no matter what i change it to in settings it stays stuck on this variant.

i want to go back to having the GUI settings in plasma control which keyboard layout i’m using.

how can i effectively undo this command and return control of my system to the GUI?

in settings i have chosen the US (Symbolic) layout and assigned the 3rd level shift key to the Right Alt key

using setxkbmap -print it even shows the following

xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us(symbolic)+inet(evdev)+compose(rctrl)+level3(ralt_switch)"        };
        xkb_geometry  { include "pc(pc104)"     };
};

but while it shows the correct layout and my choice for the 3rd level shift key, i am not able to access the symbols of this layout because it behaves as if i’m using the default US layout.

further testing has proved that while a new user can choose keyboard layouts and have them work as expected, my user still cannot.

what i’ve tried:

  • deleted ~/.cache
  • mv ~/.config ~/.configBORKED
  • mv ~/.local ~/.localBORKED
  • rebooted
  • restored time shift back up from before the trouble started

so it’s not an issue with the system and i did not use sudo with the command so, nothing ownd by root should have been affected… there has to be something in my /home dir that is not letting the keyboard layout settings work as they should.

where else can i poke?

setxkbmap appears to only modify the current X session without persisting the change, so your accidental keyboard change should be forgotten with a reboot.

Given that the new keyboard layout persists across reboots for your specific user, try looking for keyboard-related commands in the files ~/.xprofile and ~/.xinitrc.

Note that both these files are optional and may not exist in your homedir.

hi, thanks for checking in… yes i’ve since learned that setxkbmap only affects the session, so that was not likely the cause of my issues but it happened around that time so i suspected it…. altered the title to reflect this.

i do not have either of those files, perhaps i should?

i do have this file…

\~/.xbindkeysrc

c

For the benefit of emacs users: -*- shell-script -*-

###########################

xbindkeys configuration

###########################

Version: 1.8.7

If you edit this file, do not forget to uncomment any lines

that you change.

The pound(#) symbol may be used anywhere for comments.

To specify a key, you can use ‘xbindkeys --key’ or

‘xbindkeys --multikey’ and put one of the two lines in this file.

The format of a command line is:

“command to start”

associated key

A list of keys is in /usr/include/X11/keysym.h and in

/usr/include/X11/keysymdef.h

The XK_ is not needed.

List of modifier:

Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),

Mod3 (CapsLock), Mod4, Mod5 (Scroll).

The release modifier is not a standard X modifier, but you can

use it if you want to catch release events instead of press events

By defaults, xbindkeys does not pay attention with the modifiers

NumLock, CapsLock and ScrollLock.

Uncomment the lines above if you want to pay attention to them.

#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable

Examples of commands:

“xbindkeys_show”
control+shift + q

set directly keycode (here control + f with my keyboard)

#“xterm”

c:41 + m:0x4

specify a mouse button

#“xterm”

control + b:2

#“xterm -geom 50x20+20+20”

Shift+Mod2+alt + s

set directly keycode (here control+alt+mod2 + f with my keyboard)

#“xterm”

alt + c:0x29 + m:4 + mod2

Control+Shift+a release event starts rxvt

#“rxvt”

release+control+shift + a

Control + mouse button 2 release event starts rxvt

#“rxvt”

Control + b:2 + Release

##################################

End of xbindkeys configuration

##################################

but i don’t see anything in there that could causing my issues.

as indicated above, i have gone as far as removing all the usual culprits, from my profile and rebooting but the issue with the layout settings GUI persists.

currently:

  • disabled the keyboard layout widget in the system tray
  • deactivated keyboard layout switching detection in

settings > autostart > background services > keyboard daemon

  • tried deactivating configure layouts in

settings > input devices > keyboard > layouts

  • manually edited this file to contain the layout and variant of choice

/etc/X11/xorg.conf.d/00-keyboard.conf

  • run the CLI keyboard setup to change the modifier keys (layout/variant unaffected)

sudo dpkg-reconfigure keyboard-configuration

  • made a scrip to list the contents and outputs of all the relevant things (that i know of).
keyboard configuration details

------------------------------------------------ 00-keyboard.conf [etc/X11] —edit layout----

Read and parsed by systemd-localed. It’s probably wise not to edit this file

manually too freely.

Section “InputClass”
Identifier “system-keyboard”
MatchIsKeyboard “on”
Option “XkbLayout” “us”
Option “XkbVariant” “symbolgoo”
EndSection
------------------------------------------------ keyboard [etc/default] —dpkg modifiers-----

KEYBOARD CONFIGURATION FILE

Consult the keyboard(5) manual page.

XKBMODEL=“pc104”
XKBLAYOUT=“us”
XKBVARIANT=“symbolic”
BACKSPACE=“guess”
XKBOPTIONS=“lv3:ralt_switch,compose:rctrl”
------------------------------------------------ setxkbmap -query —setxkbmap session only—
rules: evdev
model: pc104
layout: us
variant: symgoo
options: lv3:ralt_switch,compose:rctrl
------------------------------------------------ setxkbmap -print —setxkbmap session only—
xkb_keymap {
xkb_keycodes { include “evdev+aliases(qwerty)” };
xkb_types { include “complete” };
xkb_compat { include “complete” };
xkb_symbols { include “pc+us(symgoo)+inet(evdev)+compose(rctrl)+level3(ralt_switch)” };
xkb_geometry { include “pc(pc104)” };
};
------------------------------------------------ layout_memory.xml [.local 5]—unaffected----

------------------------------------------------ layout_memory.xml \[.local 6\]---unaffected---- ------------------------------------------------ kxkbrc \[.config\] ---settings only affects---- \[$Version\] update_info=kxkb.upd:remove-empty-lists,kxkb.upd:add-back-resetoptions,kxkb_variants.upd:split-var iants

[Layout]
DisplayNames=,
LayoutList=us,eu,us,us,us,us,us,us,us,us,ru,ml,us,us
LayoutLoopCount=4
Options=lv3:ralt_switch,compose:rctrl
ResetOldOptions=true
Use=true
VariantList=symbolic,dvorak-mac,dvorak-intl,cz_sk_pl_de_es_fi_sv,mac,colemak,colemak_dh_wide_iso,
hbs,drix,ruchey_en,us-intl,intl-unicode,alt-intl-unicode

as you can see i’ve all but abandoned using the GUI (and ~/kxkbrc) as none of the changes there have any affect on my system…. using it now only as a convenient way to preview a number of other layouts and variants while i customize my own… coming along fine btw.

manually forcing the system to use just use one layout and variant is the only way i am able to use my computer and have that ISO shift and compose keys working.

however, i would very much like to be able to get back to using the GUI settings to control my system and be able to switch layouts again with meta+alt+k.

also found this file ~/.Xmodmap which would seem to be the layout i kept getting no matter what i changed it to in the settings GUI.

could this file be overriding the settings GUI choices?

also found ~/currentkb.xk which looks like it could also be affecting what the settings GUI is allowed to do… no idea.

i’ve since renamed both files by appending _DeleteMe to the file names and rebooted.

it does not seem to have any effect on my manual setup so i will continue to finish the layout creation for now until i get more insight onto how the setting GUI works (or doesn’t).

neither of those files seem to do anything i need done, so i’m deleting them.

but my problem was fixed by doing

sudo apt reinstall ibus-data

and then re-enabling both the system tray icon and the keyboard daemon in autostart

now, i can have 3 keyboard layouts (one of which is of my own making) and switch between them using meta+alt+k like a normal person.

apparently, according to aptitude why ibus, the plasma-desktop requires it for the switching and it conflicts with fcitx, which i believe i installed and then removed around the same time this started.

so even tho i removed fcitx, there must have been some permanent change left behind that can only be undone by reinstalling ibus… that seems like a flaw.

1 Like