c2f0fa4e6a
only display ssid tweak wifi tests
25 lines
871 B
Bash
Executable File
25 lines
871 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
######################################################################
|
|
# @author : swytch (adapted from Luke Smith - lukesmith.xyz)
|
|
# @file : sb-internet
|
|
# @license : GPLv3
|
|
# @created : Saturday Feb 13, 2021 17:35:49 CET
|
|
#
|
|
# @description : internet block for dwmblocks
|
|
######################################################################
|
|
|
|
|
|
# Wifi quality percentage and icon if ethernet is connected.
|
|
ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')"
|
|
state="$(wpa_cli status | grep -i ^wpa_state | sed -e 's/.*=//')"
|
|
[ "COMPLETED" = $state ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")"
|
|
eth="$(cat /sys/class/net/enp0s31f6/operstate)"
|
|
if [ "up" = "$eth" ]; then
|
|
str="$(printf "%s / " "$str")"
|
|
fi
|
|
vpn="$(pidof openvpn)"
|
|
[ -n "$vpn" ] && str="$(printf "() %s" "$str")"
|
|
|
|
printf " %s " "$str"
|