Fix waybar and hyprland

This commit is contained in:
albert 2023-11-12 22:45:05 +09:00
parent 53cea23814
commit 0629fabe3f
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
2 changed files with 7 additions and 7 deletions

View file

@ -5,14 +5,14 @@
executable = true;
text = ''
#!/usr/bin/env bash
CLASS=`tailscale status --json | jq -r '.BackendState'`
CLASS=`tailscale status --json | fx . '.BackendState'`
# Known values: Running, Stopped
# Expected Output:
# {"text": "$text", "alt": "$alt", "tooltip": "$tooltip", "class": "$class", "percentage": $percentage }
# Different $Class depending on if TS is running or not
if [ $CLASS == "Running" ]; then
IP=`tailscale status --json | jq -r '.TailscaleIPs[0]'`
IP=`tailscale status --json | fx . '.TailscaleIPs[0]'`
TOOLTIP="IP: $IP"
printf '{"class": "%s", "tooltip": "%s", "alt": "%s"}\n' "$CLASS" "$TOOLTIP" "$CLASS"
fi

View file

@ -29,7 +29,7 @@
"mpris",
],
"modules-center": [
"wlr/workspaces",
"hyprland/workspaces",
],
"modules-right": [
"pulseaudio",
@ -70,7 +70,7 @@
"status-icons": { "paused": "" },
},
"wlr/workspaces": {
"hyprland/workspaces": {
"on-click": "activate",
},
@ -118,8 +118,8 @@
"network": {
"format": "{ifname}",
"format-wifi": " {essid}",
"format-ethernet": " {ipaddr}",
"format-wifi": " {essid}",
"format-ethernet": " {ipaddr}",
"format-disconnected": "", // An empty format will hide the module.
"tooltip-format": "{ifname} via {gwaddr} ",
"tooltip-format-wifi": "{essid} ({signalStrength}%) ",