dotfiles

beau's configuration files
git clone https://git.beauhilton.com/dotfiles.git
Log | Files | Refs | README

internet (558B)


      1 #!/usr/bin/env sh
      2 
      3 case $BLOCK_BUTTON in
      4 	1) $TERMINAL -e nmtui ;;
      5 	3) pgrep -x dunst >/dev/null && notify-send "🌐 Internet module" "\- Click to connect
      6 📡: no wifi connection
      7 📶: wifi connection with quality
      8 ❎: no ethernet
      9 🌐: ethernet working
     10 " ;;
     11 esac
     12 
     13 [ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡"
     14 
     15 [ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')
     16 
     17 printf "%s %s\n" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/❎/;s/up/🌐/")"