summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2024-01-22 10:50:17 +0100
committertv <tv@krebsco.de>2024-01-22 10:50:17 +0100
commitcd0c248accdf44e76b13186be8faefa91895bcd9 (patch)
treeccf09be5e0d227dd5e7d1e966d37be8e3796758e /pkgs
parenta9eb76c7aa9ec3716e2c04b50c505793a4b4e18e (diff)
q-power_supply: print charge now only when not 0
Diffstat (limited to 'pkgs')
-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 7611edf..11597c1 100644
--- a/pkgs/simple/q-power_supply.nix
+++ b/pkgs/simple/q-power_supply.nix
@@ -123,7 +123,9 @@ writeDashBin "q-power_supply" ''
out = out name
out = out sprintf(" %s", print_bar(capacity))
out = out sprintf(" %d%", capacity)
- out = out sprintf(" %.2f%s", charge_now, charge_unit)
+ if (charge_now != 0) {
+ out = out sprintf(" %.2f%s", charge_now, charge_unit)
+ }
if (current_now != 0) {
out = out sprintf("/%.1f%s", current_now, current_unit)
}