summaryrefslogtreecommitdiff
path: root/i3/.config/i3blocks/bin/wifi
blob: 2e47da2466336d9043267dc66e2e515dc2579e1d (plain)
1
2
3
4
5
6
7
#!/usr/bin/env bash

quality=$(lspci | grep -i Wireless | sed 's/^.*(rev \(.*\))/\1/')
ssid=$(iwconfig wlp2s0 | grep -oP '(?<=ESSID:").*(?=")')
address=$(ip addr show wlp2s0 | grep -oP -m1 "(?<=inet ).*(?=/)")

echo "(${quality}% at ${ssid}) ${address}"