-
-
Save rubo77/1a3320fda5a47fdebde7 to your computer and use it in GitHub Desktop.
This script reacts if laptop lid is opened or closed in Ubuntu 11.10 (Oneiric Ocelot)
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 | |
######################################################################### | |
## Script written by Ruben Barkow ## | |
## ## | |
## Description: This script reacts if laptop lid is opened or ## | |
## closed in Ubuntu 11.10 (Oneiric Ocelot). ## | |
## ## | |
## This script can be freely redistributed, modified and used. ## | |
## Any redistribution must include the information of authors. ## | |
## ## | |
## THIS SCRIPT HAS NO WARRANTY! ## | |
######################################################################### | |
grep -q close /proc/acpi/button/lid/*/state | |
if [ $? = 0 ]; then | |
echo close>>/tmp/screen.lid | |
fi | |
grep -q open /proc/acpi/button/lid/*/state | |
if [ $? = 0 ]; then | |
echo open>>/tmp/screen.lid | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment