summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2024-01-22 10:50:40 +0100
committertv <tv@krebsco.de>2024-01-22 10:50:40 +0100
commit364e727359a86a047e0987c1be99909228cd5177 (patch)
treea8156b5318c50f776ab793e20dad47b1caaf0d67
parentcd0c248accdf44e76b13186be8faefa91895bcd9 (diff)
q-power_supply: print energy full only when not 0
-rw-r--r--pkgs/simple/q-power_supply.nix4
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)
}