Color stars in mpd-rate for clarity

This commit is contained in:
Henrik Lissner 2017-10-07 17:33:26 +02:00
parent 22bfd74974
commit 1f36083340
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -37,8 +37,8 @@ _clear_playlists() {
_display_stars() { _display_stars() {
# Display new rating # Display new rating
stars="" stars=""
star_filled_icon="★" star_filled_icon='\033[0;32m*\033[0m'
star_empty_icon="☆" star_empty_icon='\033[0;30m*\033[0m'
for ((i=1;i<=5;i++)); do for ((i=1;i<=5;i++)); do
if (( "$1" >= "$i" )); then if (( "$1" >= "$i" )); then
stars="${stars}${star_filled_icon}" stars="${stars}${star_filled_icon}"
@ -46,7 +46,7 @@ _display_stars() {
stars="${stars}${star_empty_icon}" stars="${stars}${star_empty_icon}"
fi fi
done done
echo "$stars" printf "$stars\n"
} }