#!/bin/sh

if [ "$1" = "" ]
then
	echo "usage: $0 notify"
	exit 1
fi

case $1 in
	0x05)
		LEVEL=$(sysctl -n dev.acpi_ibm.0.bluetooth)
		if [ "$LEVEL" = "1" ]
		then
			sysctl dev.acpi_ibm.0.bluetooth=0
			MESSAGE="bluetooth disabled"
		else
			sysctl dev.acpi_ibm.0.bluetooth=1
			MESSAGE="bluetooth enabled"
		fi
		;;
	0x10)
		MESSAGE=$(/usr/local/bin/intel_backlight incr)
		;;
	0x11)
		MESSAGE=$(/usr/local/bin/intel_backlight decr)
		;;
	*)
		MESSAGE="UNKNOWN EVENT $1"
		;;
esac
logger thinkpad_extra_keys: ${MESSAGE}
exit 0
