diff options
Diffstat (limited to 'my-x200.sh')
-rw-r--r-- | my-x200.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/my-x200.sh b/my-x200.sh new file mode 100644 index 0000000..a34d9b0 --- /dev/null +++ b/my-x200.sh | |||
@@ -0,0 +1,32 @@ | |||
1 | #!/bin/bash | ||
2 | # Default acpi script that takes an entry for all actions | ||
3 | |||
4 | case "$1" in | ||
5 | button/sleep) | ||
6 | case "$2" in | ||
7 | SLPB|SBTN) | ||
8 | logger 'SleepButton pressed' | ||
9 | /bin/loginctl suspend | ||
10 | rc-service my-x200 restart | ||
11 | ;; | ||
12 | *) | ||
13 | logger "ACPI action undefined: $2" | ||
14 | ;; | ||
15 | esac | ||
16 | ;; | ||
17 | button/lid) | ||
18 | case "$3" in | ||
19 | close) | ||
20 | /bin/loginctl suspend | ||
21 | logger 'LID closed' | ||
22 | ;; | ||
23 | open) | ||
24 | logger 'LID opened' | ||
25 | rc-service my-x200 restart | ||
26 | ;; | ||
27 | *) | ||
28 | logger "ACPI action undefined: $3" | ||
29 | ;; | ||
30 | esac | ||
31 | ;; | ||
32 | esac | ||