![David JULIEN](/assets/img/avatar_default.png)
dwm: make pinentry-gtk-3 floating window fix fonts declaration status: fix spaces + icons alias: removed unused ones + add useful others mail: add tags for univ
29 lines
921 B
Bash
Executable File
29 lines
921 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 ssid 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/.*=//')"
|
|
case "$state" in
|
|
COMPLETED) str="$(printf " %s" $ssid)" ;;
|
|
INTERFACE_DISABLED) str="WIFI DOWN" ;;
|
|
*) str="$(printf "NO WIFI")";;
|
|
esac
|
|
eth="$(cat /sys/class/net/eth0/operstate)"
|
|
if [ "up" = "$eth" ]; then
|
|
str="$(printf "%s / " "$str")"
|
|
fi
|
|
vpn="$(pidof openvpn)"
|
|
[ -n "$vpn" ] && str="$(printf "%s " "$str")"
|
|
|
|
printf " %s " "$str"
|