I could not enable shortcut to switch keyboard layout via GUI, I edited /etc/default/keyboard

7 Antworten [Letzter Beitrag]
Staircase
Offline
Beigetreten: 02/24/2022

I could not switch keyboard layout via Preferences > Hardware > Keyboard > Layouts, even when I clicked "Move up". I had to reboot each time I wanted to switch layout.

Also, when ticking the checkbox to enable shortcut Alt+Shift or Win+Space to switch keyboard layout in Preferences > Hardware > Keyboard > Layouts > Options... > Switching to another layout, none worked.

I found threads discussing similar issues on this forum dating from 2016. I am not sure if this feedback is still relevant, or redundant.

I managed to add a shortcut to switch layout by adding de and grp:alt_shift_toggle to /etc/default/keyboard such as:


# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="ca, de"
XKBVARIANT="multix"
XKBOPTIONS="grp:alt_shift_toggle"
BACKSPACE="guess"

prospero
Offline
Beigetreten: 05/20/2022

Does it help if you go to Preferences > Other > IBus Preferences and try to modify things under the "General" and "Input methods" tabs?

EDIT: in Preferences > Personal > Language Support, "Keyboard input method system" is set to "IBus". The other available values are "XIM" and "none" but I believe the recommended one is IBus.

Staircase
Offline
Beigetreten: 02/24/2022

> EDIT: in Preferences > Personal > Language Support, "Keyboard input method system" is set to "IBus". The other available values are "XIM" and "none" but I believe the recommended one is IBus.

On my computer, "Keyboard input method system" is set to "IBus".

> Does it help if you go to Preferences > Other > IBus Preferences and try to modify things under the "General" and "Input methods" tabs?

I was able to add "French (Canada)" and "Deutsch" and switch between the two using the shortcut "Super + Space" as specified on the "general" tab, however the "French (Canada)" does not match the layout I need (i.e. French Canadian Multilingual a.k.a. CSA keyboard).

I searched online to see if I could find how to add the "French Canadian Multilingual" layout to the list of layouts available under Preferences > Other > IBus Preferences > "Input methods", in vain. So I removed both "Input Method", went back to Preferences > Hardware > Keyboard > Layouts, and selected one of the two layout I had there. Then reboot.

Now, I can switch between "French Canadian Multilingual" and "Deutsch" using the shortcut I defined earlier in /etc/default/keyboard. However, I have one issue (which I had before trying out the iBus settings): the layout selected changes unwantedly. First it seemed that there was a layout switch when I switched programmes between Atril and Vim using alt + tab, but I was not able to reproduce. Then it seemed that the switch happened when using Vim alone. I don't know. I will see if I can identify a pattern.

Back to prospero's suggestion to try IBus: I'll take tips on how to add French Canadian Mutilingual to Preferences > Other > IBus Preferences "Input methods" because, when the keyboard layouts were set from there, switching layout was easier. A popup display (the same type that pops up when pressing alt + tab) was shown to indicate the switch as I pressed the keys super and space (there is no visual indicator when I switch using the shortcut I defined in /etc/default/keyboard).

EDIT: one downside of using the IBus option: one option I had in Preferences > Hardware > Keyboard > Layouts > Options..., was disabled ("Caps Lock is also Ctrl").

prospero
Offline
Beigetreten: 05/20/2022

The "French" category in the IBus Preferences input method list has several "Canadian (Intl.)" entries and a "French (Canada, legacy)" entry. Have you tried any of those?

Staircase
Offline
Beigetreten: 02/24/2022

Thanks for following up.

I don't seem to see "Canadian (Intl.)" or "French (Canada, legacy)" in the IBus Preferences Input Method list - see attached a screenshot of options I see for "French". I am running Trisquel Nabia 10.0.1, if that makes a difference in the options displayed.

The only option I see, that is close to the name of the keyboard layout I am looking for, is "French (Canada)", but that doesn't match the "French Canadian Multilingual" layout I need.

I am happy sticking to my current step up for now. That is selecting layouts in Preferences > Hardware > Keyboard > Layouts (where I found "French Canadian Multilingual") and editing /etc/default/keyboard to set a shortcut to switch between French Canadian Multilingual and Deutsch. I have not experienced the unwanted random switching between the two layout I use since I posted earlier in this thread.

ibus_preferences_input_method_french.png
prospero
Offline
Beigetreten: 05/20/2022

> I am running Trisquel Nabia 10.0.1, if that makes a difference in the options displayed.

On Trisquel 11 Aramo, there are about 40 entries in that list, including the ones I mentioned.

Staircase
Offline
Beigetreten: 02/24/2022

Good to know. Thank you.

KaKooDa
Offline
Beigetreten: 03/20/2023

I change my keyboard using this shell script it my .profile (I don't use Ibus, but I guess Ibus has a "Use system layout" option to avoid interfering with system layout)

setxkbmap -model Microsoft4000 -layout "us,ir" -variant "workman," -option "compose:menu, caps:backspace, grp:shifts_toggle"

-model : my keyboard brand
-layout : I use workman layout for English(us) (instead of qwerty) and standard for Persian(ir)
-option : you can read what this does by reading man xkeyboard-config
This changes the keyboard for the X graphical session, but there is another command which changes it for linux console (with pressing ctrl-shift-F1): ckbcomb