diff --git a/status.sh b/status.sh index 3b6691b..df3dcae 100755 --- a/status.sh +++ b/status.sh @@ -18,7 +18,8 @@ date_formatted=$(date "+%a %F %H:%M") battery_info=$(upower --show-info $(upower --enumerate |\ grep 'BAT') |\ egrep "state|percentage" |\ -awk '{print $2}') +awk -v ORS=" " '{print $2}' |\ +awk '{printf "%s%% (%s)", $2, $1}') # "amixer -M" gets the mapped volume for evaluating the percentage which # is more natural to the human ear according to "man amixer". @@ -42,4 +43,4 @@ temp=$(cat /sys/class/thermal/thermal_zone*/temp | sed 's/...$/°C/') # Mem info mem=$(free -m | grep Mem | awk '{printf "%d%%", ($3/$2)*100}') -echo "V: "$audio_volume" | M: "$mem" | B: "$battery_info" | T: "$temp" | N: "$ip_address" | "$date_formatted +echo "V:"$audio_volume" | M:"$mem" | B:"$battery_info") | T:"$temp" | N:"$ip_address" | "$date_formatted