diff options
author | Akshay <[email protected]> | 2024-07-23 21:41:13 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2024-07-23 21:41:13 +0100 |
commit | 0a3a6501c52ef3f930b83c264cccfd8d8303c26d (patch) | |
tree | 27def19fd6e747b5cd07054e37e67762a0bb6b34 /scripts | |
parent | c7f07d8e847d1711708798848ad1b4ccfdfe36c1 (diff) |
mantis
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/battery.nix | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/battery.nix b/scripts/battery.nix index 87b6cff..3aed4f9 100644 --- a/scripts/battery.nix +++ b/scripts/battery.nix | |||
@@ -17,6 +17,12 @@ pkgs.writeScriptBin name | |||
17 | 17 | ||
18 | bat_status="" | 18 | bat_status="" |
19 | bat_status=$( cat /sys/class/power_supply/BAT0/capacity ) | 19 | bat_status=$( cat /sys/class/power_supply/BAT0/capacity ) |
20 | |||
21 | if [ -z $bat_status ]; then | ||
22 | echo -ne "#[fg=color2]${symbol} #[fg=colour8]$HOSTNAME" | ||
23 | exit 0 | ||
24 | fi | ||
25 | |||
20 | charging_status=$( cat /sys/class/power_supply/BAT0/status ) | 26 | charging_status=$( cat /sys/class/power_supply/BAT0/status ) |
21 | 27 | ||
22 | health() { | 28 | health() { |