neodotfiles/user/.config/suckless/dwmblocks/scripts/block_wifi
2022-12-19 20:15:21 -04:00

11 lines
345 B
Bash
Executable file

#!/bin/bash
constate=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f3 | head -1)
currentwfi=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f4 | head -1)
if [ "$constate" = "disconnected" ]; then
echo " wfi: disc"
elif [ "$constate" = "connected" ]; then
echo " wfi: $currentwfi"
else
echo " wfi: disc"
fi