diff options
author | B Stack <bgstack15@gmail.com> | 2019-06-09 23:01:49 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-06-09 23:01:49 -0400 |
commit | 8ae5eca160cf6ba99c091d8e9f981eb1222221c1 (patch) | |
tree | af159e442fe6329c35da92fa757c551a442c1a28 /99-on-battery-time.rules | |
download | on-battery-time-8ae5eca160cf6ba99c091d8e9f981eb1222221c1.tar.gz on-battery-time-8ae5eca160cf6ba99c091d8e9f981eb1222221c1.tar.bz2 on-battery-time-8ae5eca160cf6ba99c091d8e9f981eb1222221c1.zip |
Diffstat (limited to '99-on-battery-time.rules')
-rw-r--r-- | 99-on-battery-time.rules | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/99-on-battery-time.rules b/99-on-battery-time.rules new file mode 100644 index 0000000..0ad6f8d --- /dev/null +++ b/99-on-battery-time.rules @@ -0,0 +1,12 @@ +# Rule for when switching to battery +# File: /etc/udev/rules.d/99-on-battery-time.rules +# References: +# http://www.reactivated.net/writing_udev_rules.html +# https://opensourceforu.com/2012/06/some-nifty-udev-rules-and-examples/ +# https://superuser.com/questions/1417292/udev-rule-to-start-a-command-on-ac-battery-plug-unplug-event +# https://bbs.archlinux.org/viewtopic.php?id=136396 +# https://duckduckgo.com/?q=linux+how+long+has+laptop+been+running+on+battery+-life&ia=web +SUBSYSTEM!="power_supply", GOTO="onbattery_end" +ENV{POWER_SUPPLY_ONLINE}=="0", RUN+="/usr/local/bin/onbattery.sh" +ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/usr/local/bin/onac.sh" +LABEL="onbattery_end" |