From 0df19f7206d46f091193eafa7e336c36b82e654a Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Sat, 16 Sep 2023 12:45:49 +0100 Subject: [PATCH] Added LTE compatibility --- Makefile | 1 + blocks-internet | 1 + 2 files changed, 2 insertions(+) create mode 100644 blocks-internet 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"