summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar
blob: 9f124a714999962dbf8615572e4f007fc3e209fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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