From 8ae5eca160cf6ba99c091d8e9f981eb1222221c1 Mon Sep 17 00:00:00 2001 From: B Stack Date: Sun, 9 Jun 2019 23:01:49 -0400 Subject: initial commit --- 99-on-battery-time.rules | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 99-on-battery-time.rules (limited to '99-on-battery-time.rules') 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" -- cgit