From db4cba9c242d5d6305b4c928b602498170a6e0cc Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 2 Oct 2011 15:23:13 +0200 Subject: [PATCH] xorg: configure keyboard options for Apple computers --- postplug.d/30xorg | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/postplug.d/30xorg b/postplug.d/30xorg index 00054a4..97380d4 100644 --- a/postplug.d/30xorg +++ b/postplug.d/30xorg @@ -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