obosdi-pkg/config/xorg/menu

39 lines
1.5 KiB
Text
Raw Normal View History

2015-08-20 14:37:06 -06:00
#!/bin/bash
. ./lib
options=()
options+=("Generate /etc/X11/xorg.conf.d/00-keyboard.conf" "")
options+=("Edit /etc/X11/xorg.conf.d/00-keyboard.conf" "")
defaultitem=""
2022-11-10 14:27:23 -07:00
sel=$(dialog --backtitle "$apptitle" --title "XOrg Configuration :" --default-item "$defaultitem" --cancel-button "Back" --menu "" 0 0 0 \
2015-08-20 14:37:06 -06:00
"${options[@]}" \
3>&1 1>&2 2>&3)
if [ ! "$?" = "0" ]; then
exit 1
fi
sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0
case $sel in
"Generate /etc/X11/xorg.conf.d/00-keyboard.conf")
localectl > /dev/null
if [ "$?" = "0" ]; then
script config/xorg/keyboard
else
echo '# Because dbus is not available in arch-chroot, if you run this command after reboot a best wizard is provided' > /etc/X11/xorg.conf.d/00-keyboard.conf
echo 'Section "InputClass"' >> /etc/X11/xorg.conf.d/00-keyboard.conf
echo ' Identifier "system-keyboard"' >> /etc/X11/xorg.conf.d/00-keyboard.conf
echo ' MatchIsKeyboard "on"' >> /etc/X11/xorg.conf.d/00-keyboard.conf
echo ' Option "XkbLayout" "us"' >> /etc/X11/xorg.conf.d/00-keyboard.conf
echo ' Option "XkbModel" "pc104"' >> /etc/X11/xorg.conf.d/00-keyboard.conf
echo ' Option "XkbVariant" ""' >> /etc/X11/xorg.conf.d/00-keyboard.conf
echo ' Option "XkbOptions" ""' >> /etc/X11/xorg.conf.d/00-keyboard.conf
echo 'EndSection' >> /etc/X11/xorg.conf.d/00-keyboard.conf
2018-09-15 19:36:14 -06:00
editfile /etc/X11/xorg.conf.d/00-keyboard.conf
2015-08-20 14:37:06 -06:00
fi
;;
2018-09-15 19:36:14 -06:00
"Edit /etc/X11/xorg.conf.d/00-keyboard.conf") editfile /etc/X11/xorg.conf.d/00-keyboard.conf;;
2015-08-20 14:37:06 -06:00
esac
exit 0