diff options
author | tv <tv@krebsco.de> | 2024-01-22 10:50:40 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2024-01-22 10:50:40 +0100 |
commit | 364e727359a86a047e0987c1be99909228cd5177 (patch) | |
tree | a8156b5318c50f776ab793e20dad47b1caaf0d67 /pkgs | |
parent | cd0c248accdf44e76b13186be8faefa91895bcd9 (diff) |
q-power_supply: print energy full only when not 0
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/simple/q-power_supply.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/simple/q-power_supply.nix b/pkgs/simple/q-power_supply.nix index 11597c1..5e7cd0d 100644 --- a/pkgs/simple/q-power_supply.nix +++ b/pkgs/simple/q-power_supply.nix @@ -129,7 +129,9 @@ writeDashBin "q-power_supply" '' if (current_now != 0) { out = out sprintf("/%.1f%s", current_now, current_unit) } - out = out sprintf(" %d%s", energy_full, energy_unit) + if (energy_full != 0) { + out = out sprintf(" %d%s", energy_full, energy_unit) + } if (power_now != 0) { out = out sprintf("/%.1f%s", power_now, power_unit) } |