xorg: configure keyboard options for Apple computers

This commit is contained in:
Silvan Calarco 2011-10-02 15:23:13 +02:00
parent 72aa30ee7a
commit db4cba9c24

View File

@ -10,6 +10,7 @@ fi
[ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
[ -r /etc/sysconfig/postplug ] && . /etc/sysconfig/postplug
[ -r /etc/sysconfig/machine ] && . /etc/sysconfig/machine
me="xorg"
@ -131,19 +132,33 @@ function xorg_d_configure_keyboard() {
esac
fi
cat > /etc/X11/xorg.conf.d/10-keyboard.conf << __EOF
cat > /etc/X11/xorg.conf.d/10-keyboard.conf << __EOF
Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "on"
Driver "evdev"
Option "XkbLayout" "$XKB_LAYOUT"
__EOF
[ "$XKB_MODEL" ] && echo " Option \"XkbModel\" \"$XKB_MODEL\"" >>/etc/X11/xorg.conf.d/10-keyboard.conf
[ "$XKB_VARIANT" ] && echo " Option \"XkbVariant\" \"$XKB_VARIANT\"" >>/etc/X11/xorg.conf.d/10-keyboard.conf
[ "$XKB_OPTIONS" ] && echo " Option \"XkbOptions\" \"$XKB_OPTIONS\"" >>/etc/X11/xorg.conf.d/10-keyboard.conf
echo "EndSection" >>/etc/X11/xorg.conf.d/10-keyboard.conf
[ "$XKB_MODEL" ] && echo " Option \"XkbModel\" \"$XKB_MODEL\"" >>/etc/X11/xorg.conf.d/10-keyboard.conf
[ "$XKB_VARIANT" ] && echo " Option \"XkbVariant\" \"$XKB_VARIANT\"" >>/etc/X11/xorg.conf.d/10-keyboard.conf
[ "$XKB_OPTIONS" ] && echo " Option \"XkbOptions\" \"$XKB_OPTIONS\"" >>/etc/X11/xorg.conf.d/10-keyboard.conf
echo "EndSection" >>/etc/X11/xorg.conf.d/10-keyboard.conf
}
# configure keyboard options for Apple computers
if [ "${SYSTEM_MANUFACTURER:0:5}" = "Apple" ]; then
cat > /etc/X11/xorg.conf.d/15-keyboard-apple.conf << __EOF
Section "InputClass"
Identifier "Keyboard mac"
Driver "evdev"
Option "XkbOptions" ",lv3:rwin_switch" # Mac only
MatchIsKeyboard "on"
EndSection
__EOF
else
rm /etc/X11/xorg.conf.d/15-keyboard-apple.conf
fi
}
# (re)create the '/tmp/.ICE-unix' directory with the right permissions