From 6676d5844bd5db542e491c1027ccebce30efc293 Mon Sep 17 00:00:00 2001 From: EinBowser <146022965+EinBowser@users.noreply.github.com> Date: Sat, 1 Nov 2025 22:22:58 +0100 Subject: [PATCH] changed the script to the right name, added some info and removed unnecesary debug --- .../battery/{calculate_health.sh => calculate-health.sh} | 7 ++++++- dots/.config/quickshell/ii/services/Battery.qml | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) rename dots/.config/quickshell/ii/scripts/battery/{calculate_health.sh => calculate-health.sh} (53%) diff --git a/dots/.config/quickshell/ii/scripts/battery/calculate_health.sh b/dots/.config/quickshell/ii/scripts/battery/calculate-health.sh similarity index 53% rename from dots/.config/quickshell/ii/scripts/battery/calculate_health.sh rename to dots/.config/quickshell/ii/scripts/battery/calculate-health.sh index 58a4b1d4d..83b52a5a0 100644 --- a/dots/.config/quickshell/ii/scripts/battery/calculate_health.sh +++ b/dots/.config/quickshell/ii/scripts/battery/calculate-health.sh @@ -1,6 +1,7 @@ #!/bin/bash # This just guesses that the BAT0 is the actuall battery +# because BAT0 is the default for modern systems full=$(cat /sys/class/power_supply/BAT0/charge_full) design=$(cat /sys/class/power_supply/BAT0/charge_full_design) @@ -8,4 +9,8 @@ if [ "$design" -gt 0 ]; then # basically if design > 0 awk "BEGIN { printf \"%.1f\n\", ($full/$design)*100 }" else echo "Error" -fi \ No newline at end of file +fi + +# If you have any issues try to find your "real" battery. +# Run 'ls /sys/class/power_supply'. You may see BATM or BAT1 and no BAT0 +# You can check what is what my running 'cat /sys/class/power_supply/{whatever_you_got}/model_name' diff --git a/dots/.config/quickshell/ii/services/Battery.qml b/dots/.config/quickshell/ii/services/Battery.qml index 8ff75da10..caa0ab9fe 100644 --- a/dots/.config/quickshell/ii/services/Battery.qml +++ b/dots/.config/quickshell/ii/services/Battery.qml @@ -46,7 +46,6 @@ Singleton { const value = Number(output) if (!isNaN(value)) { root.health = value - console.log("Battery health:", value) } else { console.warn("Battery script output invalid:", output) }