Created
June 26, 2017 08:35
-
-
Save s4kr4/c46aedb66992ae19e1db9bed92332b87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
. "$DOTPATH"/.zsh/20_functions.zsh | |
if [ is_cygwin ]; then | |
network_info=(`netsh wlan show interfaces | sed -e 's/\s//g' | awk -F : '{print $2}'`) | |
state=${network_info[5]} | |
ssid=${network_info[6]} | |
signal=${network_info[15]} | |
# echo "state: ${state}" | |
# echo "ssid: ${ssid}" | |
# echo "signal: ${signal}" | |
case "${state}" in | |
"connected") | |
signals=(▁ ▂ ▄ ▆ █) | |
signal_icon="" | |
signal_=`echo $((${signal%\%} / 100.0 * 5))` | |
for ((i=0; i < $signal_; i++ )); do | |
signal_icon="${signal_icon}${signals[$i]}" | |
done | |
;; | |
"authenticating") | |
signal_icon="#[fg=yellow] ... #[default]" | |
;; | |
"disconnected") | |
signal_icon="#[fg=red] ✘ #[default]" | |
;; | |
esac | |
echo "${signal_icon} | ${ssid}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment