summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-07-20 13:39:05 +0200
committer Eric Hameleers <alien@slackware.com>2016-07-20 13:39:05 +0200
commitd00e056cf71cfce98d2658d28e88aa0f063c6c49 (patch)
tree8ae21215b6ab47cc35d3adf0a2618f85d84abd7f
parentde0a890a454196769954ff36a28357e2c12d1c0a (diff)
downloadliveslak-d00e056cf71cfce98d2658d28e88aa0f063c6c49.tar.gz
liveslak-d00e056cf71cfce98d2658d28e88aa0f063c6c49.tar.xz
liveinit: optionally specify XkbOptions through the "xkb" boot parameter.
Variable XKB can be set to "XkbLayout,XkbVariant,XkbOptions". For example "xkb=ch,fr,compose:sclk,grp:alt_shift_toggle" Note that the XkbOptions can be several comma-separated values. The XkbLayout and XkbVariant values must not contain commas. You can still set just the XkbVariant by adding something like "kbd=ch xkb=,fr"
Diffstat (limited to '')
-rwxr-xr-xliveinit35
1 files changed, 25 insertions, 10 deletions
diff --git a/liveinit b/liveinit
index cbac798..8f4fa79 100755
--- a/liveinit
+++ b/liveinit
@@ -800,11 +800,16 @@ EOT
fi
if [ ! -z "$KEYMAP" -o ! -z "$XKB" ]; then
# Set a keyboard mapping in X.Org, derived from the console map if needed:
- # Variable XKB can be set to "XkbLayout,XkbVariant", like "xkb=ch,fr"
+ # Variable XKB can be set to "XkbLayout,XkbVariant,XkbOptions".
+ # For example "xkb=ch,fr,compose:sclk,grp:alt_shift_toggle"
+ # 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"
XKBLAYOUT=$(echo $XKB |cut -d, -f1)
XKBVARIANT=$(echo $XKB |cut -d, -f2)
- # Ensure that XKBLAYOUT gets a value; XKBVARIANT is allowed to be empty.
+ XKBOPTIONS=$(echo $XKB |cut -d, -f3-)
+ # Ensure that XKBLAYOUT gets a value;
+ # XKBVARIANT and XKBOPTIONS are allowed to be empty.
if [ -z "$XKBLAYOUT" ]; then
if [ -z "$KEYMAP" ]; then
XKBLAYOUT="us"
@@ -816,17 +821,27 @@ EOT
XKBLAYOUT="us"
fi
echo "${MARKER}: Switching live X desktop to '$XKBLAYOUT' keyboard"
- # Germans use the AltGr key, so Scroll Lock will be their Compose Key:
- if [ "$XKBLAYOUT" = "de" ]; then
- XKBOPTIONS="compose:sclk"
- else
- XKBOPTIONS="compose:ralt"
- fi
- # If the layout is not 'us' then add 'us' as a secondary nevertheless:
+
if [ "$XKBLAYOUT" != "us" ]; then
+ # If the layout is not 'us' then add 'us' as a secondary nevertheless:
XKBLAYOUT="$XKBLAYOUT,us"
XKBVARIANT="$XKBVARIANT,"
- XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll,$XKBOPTIONS"
+ fi
+
+ 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"
+ else
+ # Rest of the world 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