summaryrefslogtreecommitdiff
path: root/etc/functions/check_ac
diff options
context:
space:
mode:
Diffstat (limited to 'etc/functions/check_ac')
-rw-r--r--etc/functions/check_ac3
1 files changed, 3 insertions, 0 deletions
diff --git a/etc/functions/check_ac b/etc/functions/check_ac
new file mode 100644
index 0000000..6ea4bb1
--- /dev/null
+++ b/etc/functions/check_ac
@@ -0,0 +1,3 @@
+## vim:ft=zsh
+## check_ac - returns true if machine is running on AC
+[[ $(cat /sys/class/power_supply/AC/online) == 1 ]]