scripts

shell scripts
git clone git://git.bitsmanent.org/scripts
Log | Files | Refs | README

commit a4e2a56be9d385080c31ee25e3bc98ef7ef84675
parent 5fae7bf96f546a393e36897ef1be12c1e259becc
Author: clamiax <smoppy@gmail.com>
Date:   Wed,  7 Jan 2015 11:14:21 +0100

Fixed-length status

Diffstat:
Mdwmstatus | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dwmstatus b/dwmstatus @@ -29,7 +29,8 @@ getfreqs() { ret="" for f in $freqs do - f="0.$(echo "$f / 10000" |bc)" + f="$(echo "$f / 100000" |bc)" + f=$(printf "0.%0.2d" $f) [ -z "$ret" ] && ret=$f || ret="${ret} $f" done @@ -58,9 +59,7 @@ main() { freqs=$(getfreqs) temp=$(gettemp) vol=$(getvol) - - status="B:$battery T:$temp W:$iwlink V:$vol ($freqs) $date" - echo "$status" + printf "B:%s T:%s W:%s V:%-4s (%s) %s" "$battery" "$temp" "$iwlink" "$vol" "$freqs" "$date" } main "$@"