Typing glyphs on Linux: Difference between revisions

Jump to navigation Jump to search
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 28: Line 28:


* If you want to specify a different layout, dvorak, bepo, etc, change the variant flag to <syntaxhighlight lang=console inline>dvorak,dyalog</syntaxhighlight>.
* If you want to specify a different layout, dvorak, bepo, etc, change the variant flag to <syntaxhighlight lang=console inline>dvorak,dyalog</syntaxhighlight>.
=== NixOS ===
Adding these entries to <code>/etc/nixos/configuration.nix</code> will setup xkbmap to work correctly after the next time you build your configuration (usually with <code>nixos-rebuild switch</code>).
<syntaxhighlight lang=console>
  services.xserver = {
    layout = "cn,apl";
    xkbVariant = ",dyalog";
    xkbOptions = "grp:switch";
  };
</syntaxhighlight>


== libinput ==
== libinput ==
Line 134: Line 144:
== Wayland ==
== Wayland ==
Currently, [https://en.wikipedia.org/wiki/Wayland_%28display_server_protocol%29 Wayland] uses [https://www.x.org/wiki/XKB/ XKB] for keyboards, but they are not modifiable during runtime using e.g. <code lang=console>setxkbmap</code> by default. The keyboard layout must be configured and then the session restarted.
Currently, [https://en.wikipedia.org/wiki/Wayland_%28display_server_protocol%29 Wayland] uses [https://www.x.org/wiki/XKB/ XKB] for keyboards, but they are not modifiable during runtime using e.g. <code lang=console>setxkbmap</code> by default. The keyboard layout must be configured and then the session restarted.
=== Raspberry Pi "Bookworm" onwards ===
Raspbian OS has moved to its own Wayland-based desktop environment "LXDE-pi-wayfire" in Bookworm.
You can check that this is your currently running environment by inspecting the <syntaxhighlight lang=console inline>DESKTOP_SESSION</syntaxhighlight> environment variable.
<syntaxhighlight lang=console>
echo $DESKTOP_SESSION
</syntaxhighlight>
The current user can modify their keyboard configuration using XKB options by editing the file <syntaxhighlight lang=console inline>~/.config/wayfire.ini</syntaxhighlight>. These options take effect while using the graphical desktop environment.
Under the <syntaxhighlight lang=console inline>[input]</syntaxhighlight> section, set
<syntaxhighlight lang=console>
xkb_layout = gb,apl
xkb_options = grp:lswitch
</syntaxhighlight>
to use the UK keyboard layout with a <kbd>Left Alt</kbd> APL shifting key. See the [[#setxkbmap|section on setxkbmap]] for more information about XKB keyboard configuration.
To set the keyboard configuration for use in the terminal console outside of the Wayland GUI, modify <syntaxhighlight lang=console inline>/etc/default/keyboard</syntaxhighlight> to include:
<syntaxhighlight lang=console>
XKBLAYOUT="gb,apl"
XKBOPTIONS="grp:switch"
</syntaxhighlight>


=== GNOME Tweaks ===
=== GNOME Tweaks ===
Line 186: Line 223:


For users who understand the pitfalls, an example <syntaxhighlight lang=console inline>~/.Xmodmap</syntaxhighlight> can be [https://gist.github.com/Russtopia/20ae5ab571d5bed73359ca956d9010a7 found at this GitHub Gist].
For users who understand the pitfalls, an example <syntaxhighlight lang=console inline>~/.Xmodmap</syntaxhighlight> can be [https://gist.github.com/Russtopia/20ae5ab571d5bed73359ca956d9010a7 found at this GitHub Gist].
== XCompose (backtick/prefix/dead key) ==
With the [https://aplwiki.com/wiki/Typing_glyphs#Prefix_key prefix key] method, one key is assigned as a "dead key". When the dead key is pressed once, there is no output, but subsequent keypresses may produce a character. This is a common method for producing accented characters on certain keyboard layouts.
The following GitHub gists define dead key sequences which produce APL characters using the standard APL key locations.
* [https://gist.github.com/rikedyp/d5ef5a61b01b9d4227f358ea9dce5070 XComposeAPLBacktickUS]
* [https://gist.github.com/rikedyp/24c946d281b799343c82946c2f5e6428 XComposeAPLBacktickUK]
Save the contents of one of the above listed files as <syntaxhighlight lang=console inline>~/.XCompose</syntaxhighlight>. Changes should take effect the next time an application is started.


== Troubleshooting ==
== Troubleshooting ==

Navigation menu