network ssid

This commit is contained in:
Dane Williams 2020-03-15 14:18:06 -07:00
parent f929834adc
commit f04a5d8b82
4 changed files with 29 additions and 17 deletions

View file

@ -16,7 +16,7 @@ battery_status()
if [ $status = 'discharging' ]; then if [ $status = 'discharging' ]; then
echo '' echo ''
else else
echo 'Charging ' echo 'AC '
fi fi
} }

View file

@ -43,7 +43,7 @@ main()
tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ☺ " tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ☺ "
tmux set-option -g status-right "#[fg=${dark_gray},bg=${pink}] #(~/.tmux/plugins/tmux-dracula/battery.sh) " tmux set-option -g status-right "#[fg=${dark_gray},bg=${pink}] #(~/.tmux/plugins/tmux-dracula/battery.sh) "
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${cyan}] tructus " tmux set-option -ga status-right "#[fg=${dark_gray},bg=${cyan}] #(~/.tmux/plugins/tmux-dracula/network.sh) "
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat ~/.tmux/plugins/tmux-dracula/weather.txt) " tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat ~/.tmux/plugins/tmux-dracula/weather.txt) "
tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) " tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) "

View file

@ -1,15 +0,0 @@
#/usr/bin/env bash
#author: Dane Williams
#script for gathering internet connectivity info
#script is called in dracula.tmux program
main()
{
}
#run main driver function
main

27
network.sh Executable file
View file

@ -0,0 +1,27 @@
#/usr/bin/env bash
#author: Dane Williams
#script for gathering internet connectivity info
#script is called in dracula.tmux program
get_ssid()
{
if /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | awk -F: '/ SSID/{print $2}' &>/dev/null
/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | awk -F: '/ SSID/{print $2}'
else
echo 'Ethernet'
fi
}
main()
{
if ping -q -c 1 -W 1 google.com &>/dev/null; then
echo "$(get_ssid)"
else
echo 'Offline'
fi
}
#run main driver function
main