-
Notifications
You must be signed in to change notification settings - Fork 87
PluginWifi
Display WiFi network name (SSID), IP address, and signal strength with multi-platform support.
MyNetwork # Connected, excellent signal - green/ok
Office-WiFi (45%) # Connected, fair signal - yellow/warning
Cafe-Guest (18%) # Connected, weak signal - red/error
N/A # Disconnected - hidden
| Property | Value |
|---|---|
| Platform | macOS, Linux |
| Dependencies | Built-in (macOS), nmcli/iw/iwconfig (Linux) |
| Content Type | dynamic |
| Presence | conditional |
# macOS - all tools are built-in
# Linux (Debian/Ubuntu) - NetworkManager
sudo apt install network-manager
# Linux (Fedora)
sudo dnf install NetworkManager
# Linux (Arch)
sudo pacman -S networkmanager
# Linux - Alternative: iw (modern)
sudo apt install iw
# Linux - Alternative: iwconfig (legacy)
sudo apt install wireless-tools# Enable plugin
set -g @powerkit_plugins "wifi"# Enable plugin
set -g @powerkit_plugins "wifi"
# Visibility control: connected, disconnected, always
set -g @powerkit_plugin_wifi_show_when "connected"
# Display format: ssid, ip, signal (comma-separated for multiple)
set -g @powerkit_plugin_wifi_format "ssid"
set -g @powerkit_plugin_wifi_separator " | "
set -g @powerkit_plugin_wifi_max_length "20"
# Icons - signal-based (auto-selected)
set -g @powerkit_plugin_wifi_icon ""
set -g @powerkit_plugin_wifi_icon_excellent ""
set -g @powerkit_plugin_wifi_icon_good ""
set -g @powerkit_plugin_wifi_icon_fair ""
set -g @powerkit_plugin_wifi_icon_weak ""
set -g @powerkit_plugin_wifi_icon_poor ""
set -g @powerkit_plugin_wifi_icon_disconnected ""
# Cache duration (seconds)
set -g @powerkit_plugin_wifi_cache_ttl "5"| Option | Type | Default | Description |
|---|---|---|---|
@powerkit_plugin_wifi_show_when |
string | connected |
When to show: connected, disconnected, always
|
@powerkit_plugin_wifi_format |
string | ssid |
Display format: ssid, ip, signal (comma-separated for multiple) |
@powerkit_plugin_wifi_separator |
string | | |
Separator for composite format |
@powerkit_plugin_wifi_max_length |
number | 20 |
Maximum length for display text |
@powerkit_plugin_wifi_icon |
icon | |
Connected icon (full signal) |
@powerkit_plugin_wifi_icon_excellent |
icon | |
Excellent signal (80-100%) |
@powerkit_plugin_wifi_icon_good |
icon | |
Good signal (60-80%) |
@powerkit_plugin_wifi_icon_fair |
icon | |
Fair signal (40-60%) |
@powerkit_plugin_wifi_icon_weak |
icon | |
Weak signal (20-40%) |
@powerkit_plugin_wifi_icon_poor |
icon | |
Poor signal (0-20%) |
@powerkit_plugin_wifi_icon_disconnected |
icon | |
Disconnected icon |
@powerkit_plugin_wifi_cache_ttl |
number | 5 |
Cache duration in seconds |
| State | Condition | Visibility |
|---|---|---|
active |
Connected (when show_when=connected) or Disconnected (when show_when=disconnected) |
Visible |
inactive |
Not matching show_when condition |
Hidden |
Note: When show_when=always, the plugin is always visible regardless of connection state.
| Level | Condition | Color |
|---|---|---|
ok |
Signal strength > 60% | Green |
warning |
Signal strength 20-60% | Yellow |
error |
Signal strength < 20% | Red |
| Context | Description |
|---|---|
connected |
Connected to WiFi |
disconnected |
Not connected |
Icons automatically change based on signal strength:
| Signal Range | Icon | Quality | Color |
|---|---|---|---|
| 80-100% | | Excellent | Green |
| 60-80% | | Good | Green |
| 40-60% | | Fair | Yellow |
| 20-40% | | Weak | Yellow |
| 0-20% | | Poor | Red |
| Disconnected | | N/A | Hidden |
The plugin tries multiple methods in order:
| Method | Priority | Command | Notes |
|---|---|---|---|
| ipconfig | 1 | ipconfig getsummary |
Fastest, requires Location Services |
| system_profiler | 2 | system_profiler SPAirPortDataType |
Most reliable, includes signal |
| airport | 3 | airport -I |
Deprecated but works |
| networksetup | 4 | networksetup -getairportnetwork |
Basic, no signal |
| Method | Priority | Command | Notes |
|---|---|---|---|
| nmcli | 1 | nmcli -t -f active,ssid,signal dev wifi |
NetworkManager, most common |
| iw | 2 | iw dev <interface> link |
Modern, requires root on some systems |
| iwconfig | 3 | iwconfig |
Legacy, widely available |
The format option controls what information is displayed. Use comma-separated values for multiple fields.
Show network name:
set -g @powerkit_plugin_wifi_format "ssid"Output: MyNetwork
Show IP instead of SSID:
set -g @powerkit_plugin_wifi_format "ip"Output: 192.168.1.100
Show signal strength:
set -g @powerkit_plugin_wifi_format "signal"Output: 85%
Show SSID and signal:
set -g @powerkit_plugin_wifi_format "ssid,signal"Output: MyNetwork | 85%
Show all information:
set -g @powerkit_plugin_wifi_format "ssid,ip,signal"
set -g @powerkit_plugin_wifi_separator " • "Output: MyNetwork • 192.168.1.100 • 85%
set -g @powerkit_plugins "wifi"set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_format "ip"set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_format "ssid,signal"set -g @powerkit_plugins "wifi,ping,netspeed"
set -g @powerkit_plugin_wifi_format "ssid,signal"set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_show_when "always"set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_icon_excellent "📶"
set -g @powerkit_plugin_wifi_icon_poor "📵"set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_format "ssid,signal"
set -g @powerkit_plugin_wifi_separator " → "-
Check WiFi is enabled:
# macOS networksetup -getairportpower en0 # Linux nmcli radio wifi ip link show wlan0
-
List available networks:
# macOS /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s # Linux nmcli dev wifi list iw dev wlan0 scan | grep SSID
Signal strength calculation varies by platform:
- macOS: RSSI converted to percentage (-100 to -50 dBm)
- Linux: Direct percentage from driver
Quality ranges:
- Excellent: -50 dBm (100%) or 80%+
- Good: -60 dBm (80%) or 60-80%
- Fair: -70 dBm (60%) or 40-60%
- Poor: -80 dBm (40%) or 20-40%
- Very Poor: -90 dBm (20%) or < 20%
If ipconfig method fails with "" SSID:
-
Enable Location Services:
- System Settings → Privacy & Security → Location Services
- Enable for "System Services"
-
Use alternative detection method (automatic fallback)
When SSID is redacted or unavailable:
- macOS privacy settings may hide SSID
- Plugin falls back to generic "WiFi" text
- Try enabling Location Services
-
Check WiFi interface:
networksetup -listallhardwareports | grep -A 1 Wi-Fi ifconfig en0 -
Test detection methods:
# Method 1 ipconfig getsummary en0 # Method 2 system_profiler SPAirPortDataType # Method 3 /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
-
Install required tools:
sudo apt install network-manager iw wireless-tools
-
Check NetworkManager is running:
systemctl status NetworkManager sudo systemctl start NetworkManager
-
Find WiFi interface:
iw dev ip link | grep wl nmcli device -
Test detection:
nmcli -t -f active,ssid,signal dev wifi iw dev wlan0 link iwconfig wlan0
Find your WiFi interface:
# macOS
networksetup -listallhardwareports | grep -A 1 Wi-Fi
# Linux
nmcli device status | grep wifi
iw dev
ls /sys/class/net/ | grep wlCommon interface names:
-
macOS:
en0,en1 -
Linux:
wlan0,wlp2s0,wlp3s0
Some WiFi commands require root:
# Add user to netdev group
sudo usermod -aG netdev $USER
# Or use sudo for specific commands (not recommended)- WiFi detection is relatively fast (50-200ms)
- Default cache TTL is 5 seconds
- macOS ipconfig is fastest (~10ms)
- Linux nmcli is fast (~50ms)
- system_profiler is slower (~500ms) but more reliable
| Feature | macOS | Linux | Notes |
|---|---|---|---|
| SSID | ✓ | ✓ | Full support |
| Signal | ✓ | ✓ | Different calculation methods |
| IP Address | ✓ | ✓ | Full support |
| Multiple Methods | ✓ | ✓ | Automatic fallback |
Track which network you're on:
set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_format "ssid"Show connection details:
set -g @powerkit_plugins "wifi,ping,netspeed"
set -g @powerkit_plugin_wifi_format "ssid,ip,signal"Visual indicator of connection quality:
set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_format "signal"
# Icon changes based on signal strength automaticallyJust show you're connected (icon only):
set -g @powerkit_plugins "wifi"
set -g @powerkit_plugin_wifi_max_length "0"
# Only shows icon when connected- PluginNetspeed - Network traffic monitoring
- PluginPing - Network latency
- PluginVpn - VPN status
- PluginExternalip - Public IP address