#!/bin/sh NETWORK="$(scutil --nwi | awk -F': ' '/Network interfaces/ {print $2;}')" # Split devices into array IFS=' ' read -ra SERVICES <<< "$NETWORK" # Check the first device case "${SERVICES}" in # check if no devices "") ICON="󰤯" ;; # if en0, then wifi "en0") ICON="" ;; # else, must be hardwired *) ICON="" esac sketchybar --set "$NAME" icon="$ICON"