New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use multiple keyboard layouts #3578

Open
taradiddles opened this Issue Feb 13, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@taradiddles

taradiddles commented Feb 13, 2018

EDIT: a draft doc is available at https://github.com/Qubes-Community/Contents/blob/master/docs/localization/keyboard-multiple-layouts.md ; with enough interest and testing, it may get into the official qubes doc


Qubes OS version:

R4.0 (should be applicable to R3 too).

Background:

The official docs only cover how to change the layout globally - ie. both for dom0 and VMs, with a single layout [1]; issue #1396 mentioned in the FAQ entry is only about keyboard layout propagation from dom0 to VMs.

Using multiple keyboard layouts and being able to quickly switch between them (*) isn't covered. One would imagine that this use-case is ubiquitous amongst qubes users communicating both in a language with a non-latin alphabet (eg. cyrillic) and in English.

(*) changing layouts has to be fast: for instance when writing mixed cyrillic/latin emails I always have to switch back and forth between layouts at least a dozen times a minute.

[1] https://www.qubes-os.org/faq/#my-keyboard-layout-settings-are-not-behaving-correctly-what-should-i-do

Proposed improvements to documentation:

  1. Maybe we should have a page dedicated to keyboard layouts (or maybe more generally, to internationalization) and have the keyboard FAQ point to it.

  2. The following solutions exist for the multiple layouts use-case:

    1. Change the layout in dom0 with localectl ; it's a no-go as it requires a reboot
    2. Change the layout in dom0 like I suggested in #1396 with setxkbmap -layout "us,bg(phonetic)" -option "grp:shifts_toggle". This workaround proved to work more or less OK over the past 2 years but wasn't optimal:
      • there's no way to know which layout is used when typing the screensaver's password
      • sometimes the keyboard layout would not be propagated to one of the VMs, requiring a reboot of the VM.
    3. Configuring a keyboard shortcut in dom0 that would issue qvm-run vname 'setxkbmap...' to the VM whose window is under the mouse pointer (using xprop -id $(xdotool getactivewindow) ). I tried it, it works, but is a bit convoluted and qvm-run is sometimes slow when the system is under heavy I/O usage, so the layout switch doesn't happen immediately which is annoying.
    4. Best option IMO - issuing the setxkbmap ... command in each VM. This works surprisingly well. The downsides are that:
      • it requires modifying the user profile in each VM to issue the setxkbmap command, or tweaking the VM's template(s). Alternatively, maybe there's a way to issue the command from dom0 after the VM is started (I didn't investigate that yet).
      • only one layout in dom0 (since using setxkbmap... in dom0 would probably interfere with the VMs).

ideas ?

@shunju

This comment has been minimized.

Show comment
Hide comment
@shunju

shunju Feb 13, 2018

Why not use the Xfce Keyboard Layout switcher?

To add it, right-click on the top panel > Panel > Add New Items. In the opening window, pick “Keyboard Layouts”.

Customize the switcher by right-clicking > Keyboard settings. In the opening window, pick Layout tab. There you can add new keyboard layouts, define the order in which they can be scrolled though and even define a keyboard shortcut for switching layouts.

Edit: After trying this out, I realized that this will only be a solution once #1396 is solved.

shunju commented Feb 13, 2018

Why not use the Xfce Keyboard Layout switcher?

To add it, right-click on the top panel > Panel > Add New Items. In the opening window, pick “Keyboard Layouts”.

Customize the switcher by right-clicking > Keyboard settings. In the opening window, pick Layout tab. There you can add new keyboard layouts, define the order in which they can be scrolled though and even define a keyboard shortcut for switching layouts.

Edit: After trying this out, I realized that this will only be a solution once #1396 is solved.

@andrewdavidwong andrewdavidwong added this to the Documentation/website milestone Feb 14, 2018

@taradiddles

This comment has been minimized.

Show comment
Hide comment
@taradiddles

taradiddles Feb 14, 2018

Why not use the Xfce Keyboard Layout switcher?

As you saw, it doesn't work :)

But if #1396 is solved the graphical switcher would likely fall under case 2. ii.

Why not use the Xfce Keyboard Layout switcher?

As you saw, it doesn't work :)

But if #1396 is solved the graphical switcher would likely fall under case 2. ii.

@taradiddles taradiddles changed the title from documentation / how to use multiple keyboard layouts to How to use multiple keyboard layouts Feb 16, 2018

@taradiddles taradiddles referenced this issue in Qubes-Community/Contents Apr 5, 2018

Closed

Doc suggestion: multiple keyboard layouts #16

@hugoncosta

This comment has been minimized.

Show comment
Hide comment
@hugoncosta

hugoncosta Jun 27, 2018

I believe I've found a way around this. Follow me:

  1. Go to Settings - Keyboard. Make sure you have at least 2 types of keyboard.

  2. Set the "Change layout option" to something, I chose alt + shift because windows.

  3. Click on "Use system defaults"

  4. Restart VM

Seems odd, but it has worked for me.

I believe I've found a way around this. Follow me:

  1. Go to Settings - Keyboard. Make sure you have at least 2 types of keyboard.

  2. Set the "Change layout option" to something, I chose alt + shift because windows.

  3. Click on "Use system defaults"

  4. Restart VM

Seems odd, but it has worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment