[lastbash-cvs] lastbash lastbash,1.69,1.70
Status: Beta
Brought to you by:
cstroie
|
From: Costin S. <cs...@us...> - 2006-11-30 21:29:32
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14047 Modified Files: lastbash Log Message: Improved the leds string formatting. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- lastbash 30 Nov 2006 21:19:32 -0000 1.69 +++ lastbash 30 Nov 2006 21:29:29 -0000 1.70 @@ -713,7 +713,7 @@ { # $1 - the text to print - local LINE LEDS L1 L2 L3 L4 S + local LINE L1 L2 L3 L4 S # Set the leds # - R: the player is running # - P: record to profile is on @@ -722,7 +722,6 @@ [ "${META_RTP}" == "1" ] && L2="P" || L2="-" [ "${META_DISCOVERY}" == "1" ] && L3="D" || L3="-" L4="-" - LEDS="${L1}${L2}${L3}${L4}" # Compute the main field size S=$(( T_COLUMNS - 27 )) @@ -730,12 +729,12 @@ # Format the status line if [ "$1" ] then - printf -v LINE " %-${S}s %-15s [%s] " "$1" "$LASTFM_USER" "$LEDS" + printf -v LINE " %-${S}s %-15s [%c%c%c%c] " "${1:0:$S}" "${LASTFM_USER}" "${L1}" "${L2}" "${L3}" "${L4}" elif [ "${META_STREAMING}" == "true" ] then - printf -v LINE " %-${S}s %-15s [%s] " "$META_STATION" "$LASTFM_USER" "$LEDS" + printf -v LINE " %-${S}s %-15s [%c%c%c%c] " "${META_STATION:0:$S}" "${LASTFM_USER}" "${L1}" "${L2}" "${L3}" "${L4}" else - printf -v LINE " %-${S}s %-15s [%s] " "Not streaming" "$LASTFM_USER" "$LEDS" + printf -v LINE " %-${S}s %-15s [%c%c%c%c] " "Not streaming, please launch the player" "${LASTFM_USER}" "${L1}" "${L2}" "${L3}" "${L4}" fi # Move the cursor on lower-left corner and print tput cup ${T_LINES} 0 |