Files
mac-dots/sketchybar/plugins/wifi.sh
T
2026-05-14 21:16:36 +02:00

13 lines
348 B
Bash
Executable File

#!/bin/sh
# Get the current Wi-Fi SSID
wifi_name=$(networksetup -listpreferredwirelessnetworks en0 | sed -n '2 p' | tr -d '\t')
# If the Wi-Fi name is empty, set a default value (e.g., "No Wi-Fi")
if [ -z "$wifi_name" ]; then
wifi_name="Offline"
fi
# Set the Wi-Fi name as the label in SketchyBar
sketchybar --set "$NAME" label="$wifi_name"