X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=x%2F.local%2Fbin%2Fbar;h=459235ddf95f26597186d461e5d3e9231b0b0b25;hb=e89885133681524d483668a827cd1de5b16eeb2e;hp=00da72ed9fc8488ce30d88969d430d30c7b323c5;hpb=7553d3a3fcf877457ea1c93d2d7ab1e3ba11487a;p=dotfiles.git diff --git a/x/.local/bin/bar b/x/.local/bin/bar index 00da72e..459235d 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/20+1))s")" +echo "$wlan$snd$bat$dsk$date"