X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=x%2F.local%2Fbin%2Fbar;h=33e1fa425e7b3a1cb52f9e588015687228ab2863;hb=98ef8dd720b8a4c6a3a19be3d5b4972188951967;hp=8d8d0531d527b7d91d93e4a050b2ca14d80570b5;hpb=d60d891ca1f372ad7c586aaa7399ea1c7be08f11;p=dotfiles.git diff --git a/x/.local/bin/bar b/x/.local/bin/bar index 8d8d053..33e1fa4 100755 --- a/x/.local/bin/bar +++ b/x/.local/bin/bar @@ -1,4 +1,21 @@ #!/bin/sh +batprefix=/sys/class/power_supply/BAT0 +if [ -f $batprefix/charge_full -a -f $batprefix/charge_now ]; then + bat="$(echo $(cat $batprefix/charge_now)*100/$(cat $batprefix/charge_full) | bc)% |" +fi + +if ip -br a | grep -q '^wlp'; then + wlan="$(/sbin/iwconfig 2>/dev/null | grep -oP '(?<=ESSID:\").*(?=\")')" + if [ -z "$wlan" ]; then + wlan="Not connected |" + else + wlan="$wlan |" + fi +fi + echo \ - "$(date +"%Y-%m-%d %H:%M:%S")"\ - " $(df -h | grep '/$' | awk '{print $4"/"$2}')" + "W $wlan"\ + "♪ $(pactl list sinks | grep -Po "(?<=Volume: front)[^%]*" | grep -o "100$") |"\ + "⚡$bat"\ + "Dsk: $(df -h | grep '/$' | awk '{print $4"/"$2}') |"\ + "$(date +"%Y-%m-%d %H:%M:%S")"