updated icons in waybar

This commit is contained in:
2025-07-10 23:18:54 +02:00
parent 37fe2f72ad
commit ff37269ac4
3 changed files with 19 additions and 15 deletions

View File

@@ -19,17 +19,21 @@ type=$(cat "$BASE_MOUSE/device_type")
percent=$(( raw * 100 / 255 ))
tooltip="$type"
icon="󰍽"
# Choose icon + class
if [[ $status -eq 1 ]]; then
icon="⚡"
cls="charging"
text="󰍽 $icon $percent%"
icon="󰍽⚡"
class="charging"
text="$percent%"
else
cls="not_charging"
text="󰍽 $percent%"
class="not_charging"
text="$percent%"
fi
# Output Waybarfriendly JSON
printf '{"text":"%s","class":"%s","tooltip":"%s"}\n' "$text" "$cls" "$tooltip"
jq -nc \
--arg text "<span color=\"#4F84CC\">$icon</span> <span color=\"#CAD3E8\">$text</span>" \
--arg class "$class" \
--arg tooltip "$tooltip" \
'{text: $text, class: $class, tooltip: $tooltip}'