From a03c2f08b6f0285dc50e3b08b3cc095ddb240e1c Mon Sep 17 00:00:00 2001 From: Theoreticallyhugo Date: Wed, 25 Jun 2025 10:59:08 +0200 Subject: [PATCH 1/2] adding new battery status "Not charging" and documentation on the nerdfont icons --- docs/CONFIG.md | 8 ++++++++ scripts/battery.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/CONFIG.md b/docs/CONFIG.md index c5b78856..aa86cb6f 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -188,6 +188,14 @@ which will display the battery charge and whether its charging (or just drawing set -g @dracula-battery-label false set -g @dracula-show-battery-status true ``` +these settings will introduce the following icons: +- the battery is discharging and at the current level: 󰂎 󰁺 󰁻 󰁼 󰁽 󰁾 󰁿 󰂀 󰂁 󰂂 󰁹 +- the battery is charging and at the current level: 󰢟 󰢜 󰂆 󰂇 󰂈 󰢝 󰂉 󰢞 󰂊 󰂋 󰂅 +- power is being drawn from AC, but the battery is neither charging nor discharging:  +- we were able to determine that the battery is charging/ discharging, but something about the percentage went wrong: 󰂃 +- we don't know the status of the battery:  + + if you have no battery and would like the widget to hide in that case, set the following: diff --git a/scripts/battery.sh b/scripts/battery.sh index 65a20d82..acc04799 100755 --- a/scripts/battery.sh +++ b/scripts/battery.sh @@ -126,7 +126,7 @@ battery_status() ) echo "${battery_labels[$((bat_perc/10*10))]:-󰂃}" ;; - ACattached) + "ACattached"|"Not charging") # drawing from AC but not charging echo '' ;; From 082f6a6a79615e393241a1a36d4b358985abd65e Mon Sep 17 00:00:00 2001 From: Theoreticallyhugo Date: Wed, 25 Jun 2025 11:12:59 +0200 Subject: [PATCH 2/2] implementing coderabbit fixes --- docs/CONFIG.md | 10 +++++----- scripts/battery.sh | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/CONFIG.md b/docs/CONFIG.md index aa86cb6f..06d19292 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -189,11 +189,11 @@ set -g @dracula-battery-label false set -g @dracula-show-battery-status true ``` these settings will introduce the following icons: -- the battery is discharging and at the current level: 󰂎 󰁺 󰁻 󰁼 󰁽 󰁾 󰁿 󰂀 󰂁 󰂂 󰁹 -- the battery is charging and at the current level: 󰢟 󰢜 󰂆 󰂇 󰂈 󰢝 󰂉 󰢞 󰂊 󰂋 󰂅 -- power is being drawn from AC, but the battery is neither charging nor discharging:  -- we were able to determine that the battery is charging/ discharging, but something about the percentage went wrong: 󰂃 -- we don't know the status of the battery:  +- the battery is discharging and at the current level: `󰂎` `󰁺` `󰁻` `󰁼` `󰁽` `󰁾` `󰁿` `󰂀` `󰂁` `󰂂` `󰁹` +- the battery is charging and at the current level: `󰢟` `󰢜` `󰂆` `󰂇` `󰂈` `󰢝` `󰂉` `󰢞` `󰂊` `󰂋` `󰂅` +- power is being drawn from AC, but the battery is neither charging nor discharging: `` +- we were able to determine that the battery is charging/ discharging, but something about the percentage went wrong: `󰂃` +- we don't know the status of the battery: `` diff --git a/scripts/battery.sh b/scripts/battery.sh index acc04799..d96ef33f 100755 --- a/scripts/battery.sh +++ b/scripts/battery.sh @@ -126,8 +126,11 @@ battery_status() ) echo "${battery_labels[$((bat_perc/10*10))]:-󰂃}" ;; - "ACattached"|"Not charging") + ACattached|Notcharging|"Not charging") # drawing from AC but not charging + # ACattached - MacOS + # Not charging - Linux without acpi + # Notcharging - Linux with acpi echo '' ;; finishingcharge)