From 9fd0e6575439747e179be8218b0f372fedf69dc4 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 11 Nov 2018 21:23:13 -0500 Subject: new internet, date and help modules --- .scripts/statusbar/i3internet | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .scripts/statusbar/i3internet (limited to '.scripts/statusbar/i3internet') diff --git a/.scripts/statusbar/i3internet b/.scripts/statusbar/i3internet new file mode 100755 index 0000000..dba6262 --- /dev/null +++ b/.scripts/statusbar/i3internet @@ -0,0 +1,18 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) $TERMINAL -e nmtui ;; + 3) pgrep -x dunst >/dev/null && notify-send "Internet module: +- Left click for \`nmtui\` for wifi access +📡: no wifi connection +📶: wifi connection with quality +❎: no ethernet +🌐: ethernet working +" ;; +esac + +[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="📡" + +[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep ^w /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }') + +printf "%s %s" "$wifiicon" "$(cat /sys/class/net/e*/operstate | sed "s/down/❎/;s/up/🌐/")" -- cgit v1.3.1