Last active
December 26, 2015 08:09
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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