mirror of
https://github.com/nchevsky/systemrescue-zfs.git
synced 2025-12-06 07:12:01 +01:00
20 lines
603 B
Plaintext
20 lines
603 B
Plaintext
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
# Pass the name of the keyboard layout to load it directly (eg: "setkmap us")
|
||
|
|
# Pass no argument to display a menu a choose the keyboard layout from the list
|
||
|
|
|
||
|
|
keymaps=$(localectl list-keymaps)
|
||
|
|
|
||
|
|
if test -n "${1}" && localectl list-keymaps | grep -q "${1}"
|
||
|
|
then
|
||
|
|
keymap="${1}"
|
||
|
|
else
|
||
|
|
exec 3>&1
|
||
|
|
keymap=$(/sbin/dialog --title "Keyboard layout" --menu "Choose a keyboard layout" 25 50 20 $(for item in ${keymaps[@]}; do echo ${item} "-" ; done) 2>&1 1>&3) || exit 1
|
||
|
|
exec 3>&-
|
||
|
|
fi
|
||
|
|
|
||
|
|
/sbin/loadkeys ${keymap}
|
||
|
|
mkdir -p /etc/sysconfig
|
||
|
|
echo "XKEYBOARD=${keymap}" > /etc/sysconfig/keyboard
|