diff options
author | Eric Hameleers <alien@slackware.com> | 2016-07-20 17:37:13 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2016-07-20 17:37:13 +0200 |
commit | 2b7133e2802f4148d5bfc8aeecb5ac8052c27fdb (patch) | |
tree | 950995a34871d44e728736b9460309dc4ec1d66f | |
parent | db7c00f98651a6bfe343b0a0d58524f76e32008a (diff) | |
download | liveslak-2b7133e2802f4148d5bfc8aeecb5ac8052c27fdb.tar.gz liveslak-2b7133e2802f4148d5bfc8aeecb5ac8052c27fdb.tar.xz |
liveinit: use AltGr as Compose Key only for US keyboard layouts.
-rwxr-xr-x | liveinit | 35 |
1 files changed, 24 insertions, 11 deletions
@@ -805,6 +805,9 @@ EOT # Note that the XkbOptions can be several comma-separated values. # The XkbLayout and XkbVariant values must not contain commas. # You can set just the XkbVariant by adding something like "kbd=ch xkb=,fr" + + # Catch a missing comma in the "$XKB" string value which messes with 'cut': + XKB="$XKB," XKBLAYOUT=$(echo $XKB |cut -d, -f1) XKBVARIANT=$(echo $XKB |cut -d, -f2) XKBOPTIONS=$(echo $XKB |cut -d, -f3-) @@ -831,27 +834,37 @@ EOT if [ -z "$XKBOPTIONS" ]; then # If the user did not specify any X keyboard options then we will # determine a set of sane defaults: - if [ "$XKBLAYOUT" = "de" ]; then - # Germans use the AltGr key, so Scroll Lock will be their Compose Key: - XKBOPTIONS="compose:sclk" + if [ "$XKBLAYOUT" != "us" ]; then + # User should be able to switch between layouts (Alt-Shift toggles). + # Also, many languages use the AltGr key, so we will use Scroll Lock + # as the Compose Key: + XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll,compose:sclk" else - # Rest of the world use the Right Alt (AltGr): + # For US keyboard we use the Right Alt (AltGr): XKBOPTIONS="compose:ralt" fi - if [ "$XKBLAYOUT" != "us" ]; then - # User should be able to switch between layouts: - XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll,$XKBOPTIONS" - fi fi mkdir -p /mnt/overlay/etc/X11/xorg.conf.d - cat <<EOT > /mnt/overlay/etc/X11/xorg.conf.d/30-keyboard.conf + echo > /mnt/overlay/etc/X11/xorg.conf.d/30-keyboard.conf + cat <<EOT >> /mnt/overlay/etc/X11/xorg.conf.d/30-keyboard.conf Section "InputClass" Identifier "keyboard-all" + MatchIsKeyboard "on" + MatchDevicePath "/dev/input/event*" Driver "evdev" Option "XkbLayout" "$XKBLAYOUT" - Option "XkbVariant" "$XKBVARIANT" +EOT + if [ -z "$XKBVARIANT" ]; then + cat <<EOT >> /mnt/overlay/etc/X11/xorg.conf.d/30-keyboard.conf + #Option "XkbVariant" "$XKBVARIANT" +EOT + else + cat <<EOT >> /mnt/overlay/etc/X11/xorg.conf.d/30-keyboard.conf + Option "XkbVariant" "$XKBVARIANT" +EOT + fi + cat <<EOT >> /mnt/overlay/etc/X11/xorg.conf.d/30-keyboard.conf Option "XkbOptions" "$XKBOPTIONS" - MatchIsKeyboard "on" EndSection EOT |