From 2b630ca4de631b4ebe84bb364951266df74d60c8 Mon Sep 17 00:00:00 2001 From: DustVoice Date: Fri, 30 Oct 2020 13:35:51 +0100 Subject: [PATCH] Add battery-monitor alias --- .zsh_alias | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.zsh_alias b/.zsh_alias index 0667816..acbe326 100644 --- a/.zsh_alias +++ b/.zsh_alias @@ -106,6 +106,12 @@ function check-iommu-func() { } alias check-iommu='check-iommu-func' + +function battery-monitor-func() { + watch -t -n 60 '( if [ $(cat /sys/class/power_supply/ACAD/online) == "1" ]; then printf "Power connected\n"; else print "Power disconnected\n"; fi; printf "\nBattery capacity: "; cat /sys/class/power_supply/BAT1/capacity; printf "\n(Updated every 60s)"; )'; +} + +alias battery-monitor='battery-monitor-func' # === # ===