summaryrefslogtreecommitdiffstats
path: root/liveinit
diff options
context:
space:
mode:
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
commit2b7133e2802f4148d5bfc8aeecb5ac8052c27fdb (patch)
tree950995a34871d44e728736b9460309dc4ec1d66f /liveinit
parentdb7c00f98651a6bfe343b0a0d58524f76e32008a (diff)
downloadliveslak-2b7133e2802f4148d5bfc8aeecb5ac8052c27fdb.tar.gz
liveslak-2b7133e2802f4148d5bfc8aeecb5ac8052c27fdb.tar.xz
liveinit: use AltGr as Compose Key only for US keyboard layouts.
Diffstat (limited to 'liveinit')
-rwxr-xr-xliveinit35
1 files changed, 24 insertions, 11 deletions
diff --git a/liveinit b/liveinit
index 8f4fa79..bde1cb4 100755
--- a/liveinit
+++ b/liveinit
@@ -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