Replace contents with redirects to Qubes Forum

https://forum.qubes-os.org/t/21746
This commit is contained in:
Andrew David Wong 2023-10-29 17:05:36 -07:00
parent dd657a2cbd
commit 2fa8015505
No known key found for this signature in database
GPG key ID: DB4DD3BC39503030
94 changed files with 94 additions and 12417 deletions

View file

@ -1,53 +1 @@
Using multiple keyboard layouts
===============================
The [official Qubes OS faq entry](https://www.qubes-os.org/faq/#my-keyboard-layout-settings-are-not-behaving-correctly-what-should-i-do) only covers how to change the layout *globally* - ie. both for dom0 and VMs, with a *single* layout.
This document shows several ways of using *multiple* keyboard layouts and being able to *quickly* switch between them.
Recommended setup
-----------------
Run `setxkbmap` in *each* VM. Dom0 stays untouched (running `setxkbmap` in dom0 too will interfere with the VM's `setxkbmap` setup).
For instance the following command would alternate between the US English and the Bulgarian phonetic layout when pressing both shift keys:
~~~
setxkbmap -layout "us,bg(phonetic)" -option "grp:shifts_toggle"
~~~
To automatically run the `setxkbmap` command when the VM starts, add a `/etc/xdg/autostart/setxkbmap.desktop` file in the VM's *template* with the following content:
~~~
[Desktop Entry]
Name=Configure multiple keyboard layouts
Exec=setxkbmap -layout "us,bg(phonetic)" -option "grp:shifts_toggle"
Terminal=true
Type=Application
~~~
Note: for some reason, with `Terminal=false` the setxkbmap settings aren't applied until one runs `setxkbmap` without options in a terminal. Setting `Terminal=true` works around this problem, but you will notice a terminal flicker at startup.
If you prefer to have a per-vm setup rather than per-template, create a `/rw/config/setxkbmap.desktop` with the same content as above and add the following line to `/rw/config/rc.local`:
~~~
cp /rw/config/setxkbmap.desktop /etc/xdg/autostart
~~~
Note: the reason we can't put the `setxkbmap` command in the `rc.local` script is because the X server isn't running when `rc.local` is executed.
Alternatively, you could add the `setxkbmap` command to your profile's `.bashrc` file if you use terminals to start applications.
Alternative setups
------------------
- Configure a keyboard shortcut in dom0 that would run `qvm-run vname 'setxkbmap ...'`, where the VM is the one whose window is under the mouse pointer (using `xprop -id $(xdotool getactivewindow`) ). An advantage is that it doesn't require tweaking VMs or templates, but this 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.
- Change the layout with `setxkbmap` *only in dom0*. This isn't optimal because:
- there is no way to know which layout is used when typing the password in the xscreensaver's password field.
- sometimes the keyboard layout would not be propagated to one of the VMs, requiring a reboot of the VM.
- Once Qubes OS gains support for keyboard layout propagation from dom0 to VMs (see [this official issue](https://github.com/QubesOS/qubes-issues/issues/1396)) the desktop environment's keyboard layout switcher (eg. Xfce Keyboard Layout switcher) could be used instead of `setxkbmap`. It is not clear however if this solution won't have the same issues as above.
- Change the layout in dom0 with `localectl`: it's a no-go as it requires a reboot
`Contributors: @taradiddles`
This content has moved to [Qubes Forum: Community Guides](https://forum.qubes-os.org/c/guides/14). [Learn more.](https://forum.qubes-os.org/t/announcement-qubes-community-project-has-been-migrated-to-the-forum/20367/)

View file

@ -1,63 +1 @@
Using multiple languages in dom0
================================
Installing additional languages
-------------------------------
Switching languages is pretty easy in your domUs. However, in dom0, there's only
English available after installation if no additional languages have been installed.
To install more languages in dom0, use the following command:
~~~
sudo qubes-dom0-update glibc-langpack-LANGUAGE
~~~
Note that `LANGUAGE` should be a valid language code, e.g. `en` for English, `de` for
German, `it` for Italian and so on.
You can check which languages are available on your system using:
~~~
localectl list-locales
~~~
Setting a language globally
---------------------------
If you want to switch your whole dom0 from English to some other language,
edit the file `/etc/locale.conf` to include your language code for the `LANG=` value.
For example, to change your dom0 to Italian, the file `/etc/locale.conf` should contain:
~~~
LANG="it_IT.UTF-8"
~~~
Important: Using some language other than English is not officially supported, i.e. you
might still get a lot of English content which has not been translated to your desired language.
Setting only some formats
-------------------------
If you just want to change some format specifiers, you can add the `LC_*` identifier
in the same file, below the `LANG=` code. Avoid the `LC_ALL` identifier, because it overwrites
all previous settings! For example, to use German time formats but still use the English
language as default for anything else, you would write the following in `/etc/locale.conf`:
~~~
LANG="en_US.UTF-8"
LC_TIME="de_DE.UTF-8"
~~~
Those codes must be supported by your dom0 (check with `localectl list-locales`).
After you finished editing, check your new setup with `localectl status`. You might need
to logout and login back again to enable your changes in the environment (e.g. in the window
manager or its applets).
You might also want to inspect the changes introduced by adding/editing one `LC_*` rule
in the config file. Use `locale -k $rule` for this purpose, e.g. `locale -k LC_TIME` to
show the formats exported by the setting of the `LC_TIME`.
If you see "broken characters" like `<60>` somewhere, check the encoding of the affected
application. The default terminal emulator in dom0 does not use Unicode as default
encoding and therefore has some problems when it's not adjusted accordingly.
This content has moved to [Qubes Forum: Community Guides](https://forum.qubes-os.org/c/guides/14). [Learn more.](https://forum.qubes-os.org/t/announcement-qubes-community-project-has-been-migrated-to-the-forum/20367/)