dotfiles/.config/xmobar/scripts/network.sh
afonsofrancof f6b77a9118 Icon fixes
2022-11-01 01:13:27 +00:00

13 lines
433 B
Bash
Executable file

#!/bin/bash
TYPES=($(nmcli device show | grep "GENERAL.TYPE" | awk '{print $2}'))
STATES=($(nmcli device show | grep "GENERAL.STATE" | awk '{print $3}'))
for ((i = 0; i < "${#TYPES[@]}"; i++)); do
if [[ ${STATES[$i]} = "(connected)" ]]; then
if [[ ${TYPES[$i]} == *"wifi"* ]]; then
echo "<fc=#DFDFDF><fn=3>直</fn></fc>"
else
echo "<fc=#DFDFDF><fn=5>ﯱ</fn></fc>"
fi
fi
done