X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=x%2F.local%2Fbin%2Fbar;h=76d6e065c968c21b8caaae503f1750dc31309b70;hb=627af670b097344fd249983d5ea6fdc54f10c34e;hp=708160e5f259e89d5b1cd1f10732c5d4d39983dd;hpb=d59e32339d512e4655b250563080e2507b58c698;p=dotfiles.git diff --git a/x/.local/bin/bar b/x/.local/bin/bar index 708160e..76d6e06 100755 --- a/x/.local/bin/bar +++ b/x/.local/bin/bar @@ -1,24 +1,19 @@ #!/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)% |" + 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 |" + wlan="Not connected" fi + wlan="W $wlan | " fi -eval $(xdotool search --onlyvisible trayer getwindowgeometry --shell) +snd="♪ $(pactl list sinks | grep -Po "(?<=Volume: front)[^%]*" | grep -o "[0-9]\?[0-9][0-9]$" | head -n 1) | " +dsk="Dsk: $(df -h | grep '/$' | awk '{print $4"/"$2}') | " +date="$(date +"%Y-%m-%d %H:%M:%S") " -echo \ - "W $wlan"\ - "♪ $(pactl list sinks | grep -Po "(?<=Volume: front)[^%]*" | grep -o "[0-9]\?[0-9][0-9]$") |"\ - "⚡$bat"\ - "Dsk: $(df -h | grep '/$' | awk '{print $4"/"$2}') |"\ - "$(date +"%Y-%m-%d %H:%M:%S") "\ - "$(printf "% $(((WIDTH-2)/10))s")" +echo "$wlan$snd$bat$dsk$date"