updated icons in waybar
This commit is contained in:
@@ -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 Waybar‐friendly 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}'
|
||||
|
||||
|
Reference in New Issue
Block a user