From: Mart Lubbers Date: Thu, 15 Nov 2018 08:50:40 +0000 (+0100) Subject: improve bar X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=627af670b097344fd249983d5ea6fdc54f10c34e;p=dotfiles.git improve bar --- diff --git a/x/.local/bin/bar b/x/.local/bin/bar index 00da72e..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/20+1))s")" +echo "$wlan$snd$bat$dsk$date"