summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar
diff options
context:
space:
mode:
authorOlivia Mackintosh <livvy@base.nu>2022-08-13 21:46:37 +0200
committerOlivia Mackintosh <livvy@base.nu>2022-08-13 21:46:37 +0200
commit48cc40f50ae24d187dca24112a9ebd7dccc5f42d (patch)
treef8b1f3771f350c1cb53f0299d08c9c3e10926f76 /.local/bin/statusbar
parent6dc5cf898e63237ed592a5376b375f12b3cbd8f2 (diff)
downloaddotfiles-48cc40f50ae24d187dca24112a9ebd7dccc5f42d.tar.gz
scripts: statusbar and linkhandler
Diffstat (limited to '.local/bin/statusbar')
-rwxr-xr-x.local/bin/statusbar28
1 files changed, 28 insertions, 0 deletions
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"\
+ "`</sys/class/power_supply/BAT0/capacity`"\
+ "`date "+W%V %d/%m %T%:::z"`")"
+sleep 1
+done