diff options
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() { |