feat(waybar): drop eww and simplify components

This commit is contained in:
2026-03-13 23:41:52 +01:00
parent dd9e8b5981
commit 07e5e31722
19 changed files with 20 additions and 1466 deletions

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
# wrap swaync subscription, hide when no notifications
swaync-client -swb 2>/dev/null | while read -r line; do
count=$(echo "$line" | jq -r '.text // "0"')
class=$(echo "$line" | jq -r '.class // "none"')
if [[ "$count" == "0" ]]; then
echo '{"text": "", "class": "none"}'
else
jq -nc --arg text "󰂚 $count" --arg class "$class" '{$text,$class}'
fi
done

View File

@@ -1,40 +0,0 @@
#!/usr/bin/env bash
# check wireguard and tailscale status
# outputs waybar JSON; empty when inactive
parts=()
tooltip_parts=()
if command -v wg &>/dev/null; then
ifaces=$(wg show interfaces 2>/dev/null)
if [[ -n "$ifaces" ]]; then
parts+=("󰖂")
tooltip_parts+=("wireguard: $ifaces")
fi
fi
if command -v tailscale &>/dev/null; then
ts_json=$(tailscale status --json 2>/dev/null)
state=$(jq -r '.BackendState // empty' <<<"$ts_json")
if [[ "$state" == "Running" ]]; then
ts_ip=$(jq -r '.TailscaleIPs[0] // empty' <<<"$ts_json")
ts_name=$(jq -r '.Self.HostName // empty' <<<"$ts_json")
ts_exit=$(jq -r '.ExitNodeStatus.ID // empty' <<<"$ts_json")
parts+=("󰒒")
tip="tailscale: ${ts_name} ${ts_ip}"
if [[ -n "$ts_exit" ]]; then
tip="$tip (exit node)"
fi
tooltip_parts+=("$tip")
fi
fi
if [[ ${#parts[@]} -gt 0 ]]; then
text="${parts[*]}"
tip=$(printf '%s\\n' "${tooltip_parts[@]}")
# strip trailing \n
tip=${tip%\\n}
jq -nc --arg text "$text" --arg tooltip "$tip" --arg class "active" \
'{$text,$class,$tooltip}'
fi