From 3c3b78ecde4ac463eb9d8dc35c1af2c65f3c7aab Mon Sep 17 00:00:00 2001 From: Andreas Loibl Date: Sun, 25 Aug 2013 10:15:24 +0200 Subject: keyboard layout and MacBook trackpad fixes --- config/chroot_local-hooks/01-macbook | 16 +++++++++++----- config/chroot_local-hooks/initramfs-usbmouse-hack | 3 +++ .../chroot_local-includes/lib/live/config/0030-macbook | 13 +++++++++++++ .../lib/live/config/8000-kde-keyboard-layout | 2 ++ 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100755 config/chroot_local-hooks/initramfs-usbmouse-hack create mode 100755 config/chroot_local-includes/lib/live/config/0030-macbook diff --git a/config/chroot_local-hooks/01-macbook b/config/chroot_local-hooks/01-macbook index 3dd48fb..745c490 100755 --- a/config/chroot_local-hooks/01-macbook +++ b/config/chroot_local-hooks/01-macbook @@ -1,13 +1,19 @@ #!/bin/sh +exit 0 # hook disabled mkdir -p /etc/skel/.kde/Autostart -cat >/etc/skel/.kde/Autostart/macbook.sh </etc/skel/.kde/Autostart/macbook.sh <<"MAC" #!/bin/sh if grep -q "Apple.*Keyboard" /proc/bus/input/devices; then setxkbmap -model macbook79 - if [ -f ~/.kde/share/config/synaptiksrc-macbook ]; then - mv -f ~/.kde/share/config/synaptiksrc-macbook ~/.kde/share/config/synaptiksrc - qdbus org.kde.synaptiks /modules/synaptiks org.kde.Synaptiks.reparseConfiguration - fi + + # reverse scroll wheel + set -- $(xmodmap -pp | tail -n+5 | awk '{print $2}') + xmodmap -e "pointer = $(echo "$1 $2 $3 5 4"; shift 5; echo "$@")" + sed -i 's/\(ReverseScrollPolarity\)=.*$/\1=true/' ~/.kde/share/config/kcminputrc + + # disable tap = click because Apple Trackpads have an own click button + sed -i 's/^\(.*"f1_tap_action":\) [01]\(.*\)$/\1 0\2/' ~/.config/synaptiks/touchpad-config.json + synaptikscfg load fi MAC chmod +x /etc/skel/.kde/Autostart/macbook.sh diff --git a/config/chroot_local-hooks/initramfs-usbmouse-hack b/config/chroot_local-hooks/initramfs-usbmouse-hack new file mode 100755 index 0000000..349d173 --- /dev/null +++ b/config/chroot_local-hooks/initramfs-usbmouse-hack @@ -0,0 +1,3 @@ +#!/bin/bash +# fixes mouse for Macbook Trackpad +sed -i "s/\(hid-zydacron.ko\)$/\1 usbmouse.ko/" /usr/share/initramfs-tools/hook-functions diff --git a/config/chroot_local-includes/lib/live/config/0030-macbook b/config/chroot_local-includes/lib/live/config/0030-macbook new file mode 100755 index 0000000..3dfebb4 --- /dev/null +++ b/config/chroot_local-includes/lib/live/config/0030-macbook @@ -0,0 +1,13 @@ +#!/bin/bash +if grep -q "Apple.*Keyboard" /proc/bus/input/devices; then + # set keyboard model to macbook79 + echo "keyboard-configuration keyboard-configuration/modelcode select macbook79" | debconf-set-selections + sed -i -e "s|^XKBMODEL=.*$|XKBMODEL=\"macbook79\"|" /etc/default/keyboard + + # reverse scroll wheel + echo "[Mouse]" > /etc/skel/.kde/share/config/kcminputrc + echo "ReverseScrollPolarity=true" >> /etc/skel/.kde/share/config/kcminputrc + + # disable tap = click because Apple Trackpads have an own click button + sed -i 's/^\(.*"f1_tap_action":\) [01]\(.*\)$/\1 0\2/' /etc/skel/.config/synaptiks/touchpad-config.json +fi diff --git a/config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout b/config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout index 62e3927..d83cb7f 100755 --- a/config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout +++ b/config/chroot_local-includes/lib/live/config/8000-kde-keyboard-layout @@ -52,6 +52,8 @@ Configure_kdekeyboardlayout () else sed -i 's/^\(DisplayNames\|LayoutList\)=/\1='$LIVE_KEYBOARD_LAYOUTS',/; s/,$//' "$KXKBRC" fi + [ -r /etc/default/keyboard ] && . /etc/default/keyboard + [ "$XKBMODEL" ] && kwriteconfig --file "$KXKBRC" --group Layout --key Model --type string "$XKBMODEL" # Creating state file touch /var/lib/live/config/kdekeyboardlayout -- cgit v1.0