diff options
| author | 2026-04-21 01:47:08 +0100 | |
|---|---|---|
| committer | 2026-04-21 01:47:08 +0100 | |
| commit | cd0071297b904028024fcd7a7035516d7d2942de (patch) | |
| tree | 0cd7b6e499deb378edb6d904ce6317e0002bb967 /dot_config/waybar/executable_wifi-status.sh | |
| parent | 8ea24d187be75a31700e118da494e2678ad7e5b9 (diff) | |
| download | dotfiles-cd0071297b904028024fcd7a7035516d7d2942de.tar.gz dotfiles-cd0071297b904028024fcd7a7035516d7d2942de.tar.bz2 dotfiles-cd0071297b904028024fcd7a7035516d7d2942de.zip | |
- bootstrap.sh: the trailing backslash in the efibootmgr example is
literal text shown to the user, not shell line continuation.
Disable SC1003 with an inline directive and switch back to single
quotes so the backslash renders as-is.
- wifi-status.sh: reformat with shfmt -i 2 -ci -s.
Diffstat (limited to 'dot_config/waybar/executable_wifi-status.sh')
| -rwxr-xr-x | dot_config/waybar/executable_wifi-status.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dot_config/waybar/executable_wifi-status.sh b/dot_config/waybar/executable_wifi-status.sh index eae2ff3..b0cd214 100755 --- a/dot_config/waybar/executable_wifi-status.sh +++ b/dot_config/waybar/executable_wifi-status.sh @@ -10,14 +10,14 @@ iface=wlan0 svc=net.connman.iwd down() { - printf '{"text":"wifi off","class":"down"}\n' - exit 0 + printf '{"text":"wifi off","class":"down"}\n' + exit 0 } # Locate the iwd object path for this interface. station=$(busctl --system --json=short call "$svc" / \ - org.freedesktop.DBus.ObjectManager GetManagedObjects 2>/dev/null | - jq -r --arg iface "$iface" ' + org.freedesktop.DBus.ObjectManager GetManagedObjects 2>/dev/null | + jq -r --arg iface "$iface" ' (.data[0] // .data) as $objs | $objs | to_entries[] | select(.value["net.connman.iwd.Device"].Name.data == $iface) @@ -25,13 +25,13 @@ station=$(busctl --system --json=short call "$svc" / \ [ -n "$station" ] || down state=$(busctl --system --json=short get-property "$svc" "$station" \ - net.connman.iwd.Station State 2>/dev/null | jq -r '.data' 2>/dev/null || true) + net.connman.iwd.Station State 2>/dev/null | jq -r '.data' 2>/dev/null || true) [ "$state" = "connected" ] || down netpath=$(busctl --system --json=short get-property "$svc" "$station" \ - net.connman.iwd.Station ConnectedNetwork | jq -r '.data') + net.connman.iwd.Station ConnectedNetwork | jq -r '.data') ssid=$(busctl --system --json=short get-property "$svc" "$netpath" \ - net.connman.iwd.Network Name | jq -r '.data') + net.connman.iwd.Network Name | jq -r '.data') # /proc/net/wireless: "<iface>: <status> <qual>. <level>. <noise>. ..." # We want <level> (column 4), which is dBm. Strip trailing dot. @@ -47,4 +47,4 @@ color=$(awk -v p="$pct" 'BEGIN{ }') printf '{"text":"%s <span color=\x27%s\x27>%s%%</span>","class":"up","tooltip":"%s ยท %s dBm"}\n' \ - "$ssid" "$color" "$pct" "$iface" "$rssi" + "$ssid" "$color" "$pct" "$iface" "$rssi" |
