From 48cc40f50ae24d187dca24112a9ebd7dccc5f42d Mon Sep 17 00:00:00 2001 From: Olivia Mackintosh Date: Sat, 13 Aug 2022 21:46:37 +0200 Subject: scripts: statusbar and linkhandler --- .local/bin/statusbar | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 .local/bin/statusbar (limited to '.local/bin/statusbar') diff --git a/.local/bin/statusbar b/.local/bin/statusbar new file mode 100755 index 0000000..9f124a7 --- /dev/null +++ b/.local/bin/statusbar @@ -0,0 +1,28 @@ +#!/bin/sh + +print_wifi() { + if=wlan0 + while IFS=$': \t' read -r label value + do + case $label in SSID) SSID=$value + ;; + signal) SIGNAL=$value + ;; + esac + done < <(iw "$if" link) + test "$SIGNAL" && echo -e "$SSID $SIGNAL" +} + + + +while true +do + xsetroot -name\ + "$(printf "%s %s %s %s%% %s"\ + "$(print_wifi)"\ + "`ip -4 -j a show wlan0 | jq -r ".[0].addr_info[0].local"`"\ + "$(($(cat /proc/meminfo|grep MemAvailable | awk '{print $2}')/1024))M"\ + "`