Skip to content

Instantly share code, notes, and snippets.

@jeremija
Last active December 26, 2015 08:09
Show Gist options
  • Save jeremija/7120452 to your computer and use it in GitHub Desktop.
Save jeremija/7120452 to your computer and use it in GitHub Desktop.
Scripts for blinking of the power LED on a Thinkpad X230. You can use the `thinklight-led.sh "0 blink"` in any application which can execute a command on an event.
#!/bin/sh
#
# Place this file in /usr/local/bin folder.
# You might want to edit the /etc/sudoers file and add a line like this:
# $user ALL=NOPASSWD: /usr/local/bin/thinklight-led.sh
#
# Replace the $user variable with your username.
#
# author: www.github.com/jeremija
#
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
cat << EOF
Usage: $0 "<ledId> on|off|blink"
EOF
exit 1;
fi
echo "$1" > /proc/acpi/ibm/led
# /etc/acpi/events/thinkvantage
#
# You can use acpi_listen to determine event names.
#
# author: www.github.com/jeremija
#
event=ibm/hotkey HKEY 00000080 00001018
action=/etc/acpi/thinkvantage.sh
#!/bin/sh
#
# Put this file in /etc/acpi/thinkvantage.sh
#
# author: www.github.com/jeremija
#
thinklight-led.sh "0 on"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment