Skip to content

Instantly share code, notes, and snippets.

@coolaj86
Created July 30, 2012 03:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save coolaj86/3204240 to your computer and use it in GitHub Desktop.
Save coolaj86/3204240 to your computer and use it in GitHub Desktop.
/Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

PC Keyboard Hack on OS X 10.8 Mountain Lion

TL;DR

sudo curl \
    -L https://raw.github.com/gist/3204240/ed7e118ca6e50071576bb33be7bab3201dc38d04/kext.sh \
    -o /Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

Instructions

  1. Open Terminal, iTerm, or whatever you use.

  2. Install PCKeyboardHack for OS X 10.7

  3. For safety's sake, inspect the current kext loader

    cat /Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

  4. For safety's sake, inspect the updated kext loader https://raw.github.com/gist/3204240/ed7e118ca6e50071576bb33be7bab3201dc38d04/kext.sh

  5. Copy the updated kext loader over the original

    sudo curl
    -L https://raw.github.com/gist/3204240/ed7e118ca6e50071576bb33be7bab3201dc38d04/kext.sh
    -o /Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

  6. Now verify that the file is what you expect:

    cat /Library/org.pqrs/PCKeyboardHack/scripts/kext.sh

  7. REBOOT!

P.S. None of this genius is credit to me. See discussion at pqrs-org/Seil#8

#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH
basedir="/Library/org.pqrs/PCKeyboardHack"
kextfile=''
uname=`uname -r`
case "${uname%%.*}" in
10)
kextfile="$basedir/PCKeyboardHack.10.6.kext"
;;
11)
kextfile="$basedir/PCKeyboardHack.10.7.kext"
;;
12)
kextfile="$basedir/PCKeyboardHack.10.7.kext" # Hack to use 10.7 kext in 10.8
;;
esac
if [ "x$kextfile" == 'x' ]; then
exit 1
fi
if [ "$1" == 'unload' ]; then
kextunload -b org.pqrs.driver.PCKeyboardHack
else
kextload "$kextfile"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment