#!/bin/sh # Depends on 'iwd' # Get current network SSID # Get SSID name and format properly ssid=$(iwctl station wlan0 show | grep network | cut -d " " -f 19-23 | awk -F " " '{print $1}') # If $ssid variable is empty, display "Disconnected" # Display network SSID otherwise [ -z "$ssid" ] && echo "Disconnected" || echo "$ssid"