Add nicer formatting on battery info
This commit is contained in:
@ -18,7 +18,8 @@ date_formatted=$(date "+%a %F %H:%M")
|
|||||||
battery_info=$(upower --show-info $(upower --enumerate |\
|
battery_info=$(upower --show-info $(upower --enumerate |\
|
||||||
grep 'BAT') |\
|
grep 'BAT') |\
|
||||||
egrep "state|percentage" |\
|
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
|
# "amixer -M" gets the mapped volume for evaluating the percentage which
|
||||||
# is more natural to the human ear according to "man amixer".
|
# 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 info
|
||||||
mem=$(free -m | grep Mem | awk '{printf "%d%%", ($3/$2)*100}')
|
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
|
||||||
|
Reference in New Issue
Block a user