From cd0c248accdf44e76b13186be8faefa91895bcd9 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 22 Jan 2024 10:50:17 +0100 Subject: q-power_supply: print charge now only when not 0 --- pkgs/simple/q-power_supply.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) } -- cgit v1.2.3