diff options
author | tv <tv@krebsco.de> | 2024-01-22 10:50:17 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2024-01-22 10:50:17 +0100 |
commit | cd0c248accdf44e76b13186be8faefa91895bcd9 (patch) | |
tree | ccf09be5e0d227dd5e7d1e966d37be8e3796758e | |
parent | a9eb76c7aa9ec3716e2c04b50c505793a4b4e18e (diff) |
q-power_supply: print charge now only when not 0
-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 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) } |