From 627af670b097344fd249983d5ea6fdc54f10c34e Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 15 Nov 2018 09:50:40 +0100 Subject: [PATCH] improve bar --- x/.local/bin/bar | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) 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" -- 2.20.1