From 4321224d1d2437295560d9277fceefb839592441 Mon Sep 17 00:00:00 2001 From: Honney Date: Mon, 8 Jun 2026 12:31:30 +0200 Subject: [PATCH] Added charging Icon to default battery layout --- modules/bar/scripts/Apps.sh | 3 +++ modules/bar/widgets/Battery.qml | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/bar/scripts/Apps.sh b/modules/bar/scripts/Apps.sh index 2f1f96c..64ad313 100755 --- a/modules/bar/scripts/Apps.sh +++ b/modules/bar/scripts/Apps.sh @@ -118,6 +118,9 @@ declare -A MAP=( ["viewnior"]="" # Image Editor ["gimp"]="󱇣" + ["org.inkscape.Inkscape"]="󱇣" + # CNC + ["LightBurn"]="󱇣" ) # APPS=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id == $ID) | .initialTitle") diff --git a/modules/bar/widgets/Battery.qml b/modules/bar/widgets/Battery.qml index 95145d7..09c18d5 100644 --- a/modules/bar/widgets/Battery.qml +++ b/modules/bar/widgets/Battery.qml @@ -42,7 +42,26 @@ MouseArea { font.family: "Nerd Font" color: ( BatteryState.charging ? BatteryState.percentage == 100 ? "white" : "green" : - BatteryState.percentage < 5 ? "red" : + BatteryState.percentage <= 5 ? "red" : + BatteryState.percentage < 10 ? "yellow" : + batteryButton.containsMouse ? Colors.tertiary_fg : + Colors.primary + ) + } + + Text { + id: batteryChargingText + visible : !clicked && BatteryState.charging + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + text: "󱐋" + style: Text.Outline + styleColor: Colors.tertiaryContainer + font.pixelSize: 26 + font.family: "Nerd Font" + color: ( + BatteryState.charging ? BatteryState.percentage == 100 ? "white" : "green" : + BatteryState.percentage <= 5 ? "red" : BatteryState.percentage < 10 ? "yellow" : batteryButton.containsMouse ? Colors.tertiary_fg : Colors.primary @@ -70,7 +89,7 @@ MouseArea { font.pixelSize: BatteryState.charging ? "󰂄" : batteryText.font.pixelSize*0.75 font.family: "Nerd Font" color: ( - BatteryState.percentage < 5 ? "red" : + BatteryState.percentage <= 5 ? "red" : BatteryState.charging ? "green" : BatteryState.percentage < 10 ? "yellow" : batteryButton.containsMouse ? Colors.tertiary_fg :