Skip to content
Browse files

zztlp: check param; show help text

  • Loading branch information...
1 parent 927689c commit cbe3fffa9c88fe14790e66bfa4b7d4881c12185c Thomas Koch committed
Showing with 25 additions and 1 deletion.
  1. +1 −0 debian/changelog
  2. +24 −1 zztlp
View
1 debian/changelog
@@ -4,6 +4,7 @@ tlp (0.3.2.900-1) lucid; urgency=low
* Features, other changes
- set_charge_thresholds(): check for undefined thresh values
- set_extfs_commit(): skip bind mounts (Fedora sandbox)
+ - zztlp: check param; show help text
* Bug Fix
- #24: openSUSE 11.4/2.6.37 - writing to autosuspend_delay_ms fails
-> fallback to autosuspend
View
25 zztlp
@@ -1,3 +1,26 @@
#!/bin/sh
# tlp - power state change hook
-[ -x /usr/sbin/tlp ] && { sleep 2; /usr/sbin/tlp $1; }
+TLP="/usr/sbin/tlp"
+
+print_help() {
+ cat << EOF
+--------
+${0}: trigger $TLP on power state change.
+EOF
+}
+
+case "$1" in
+ true|false)
+ [ -x $TLP ] || exit 0
+ sleep 2
+ $TLP $1
+ ;;
+
+ help)
+ print_help
+ ;;
+
+ *)
+ exit $NA
+ ;;
+esac

0 comments on commit cbe3fff

Please sign in to comment.
Something went wrong with that request. Please try again.