diff --git a/Makefile b/Makefile index e157553..aa289e8 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ install: output install -m 0755 someblocks $(DESTDIR)$(PREFIX)/bin/someblocks install -m 0755 blocks-battery $(DESTDIR)$(PREFIX)/bin/blocks-battery install -m 0755 blocks-mail $(DESTDIR)$(PREFIX)/bin/blocks-mail + install -m 0755 blocks-internet $(DESTDIR)$(PREFIX)/bin/blocks-internet mkdir -p $(DESTDIR)$(MANPREFIX)/man1 install -m 0644 someblocks.1 $(DESTDIR)$(MANPREFIX)/man1/someblocks.1 uninstall: diff --git a/blocks-internet b/blocks-internet new file mode 100644 index 0000000..72c10f3 --- /dev/null +++ b/blocks-internet @@ -0,0 +1 @@ +nmcli -t -f active,ssid dev wifi | grep -E 'yes' | cut -c 5- | grep . || (mmcli -m /org/freedesktop/ModemManager1/Modem/0 | grep "operator name:" | cut -c 38- | tr -d '\n' && echo -n ": " && mmcli -m /org/freedesktop/ModemManager1/Modem/0 | grep -P "(\d{3}|\d{2})%" -o) || echo "Disconnected"