#!/bin/sh

status=$(nmcli g | grep -oE "disconnected")
essid=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d: -f2)
device=$(nmcli d | rg -w "connected" | awk '{print $1}')

if [ $status ] ; then
    icon="睊"
    text=""
    col="#575268"

else
    if [ $device == "enp0s31f6" ]; then
        icon=""
        text="ethernet"
        col="#a1bdce"
    else
        icon=""
        text="${essid}"
        col="#a1bdce"
    fi
fi


case $1 in
	--COL) echo $col;;
	--ESSID) echo $text;;
	--ICON) echo $icon;;
esac
