Support setting current
[khome.git] / home / bin / mpd_top
CommitLineData
6fe00273
SK
1#! /bin/sh
2
3case "$1" in
4 '') N=10;;
5 *) N="$1"
6esac
7
8grep -a 'player: *played' "$FILE_LOG_MPD" \
9| awk '
10 BEGIN {
11 s = " *"
12 }
13
14 $5 == "player:" && $6 == "played" {
15 sub("^" s $1 s $2 s $3 s $4 s $5 s $6 s, "")
16 count[$0]++
17 }
18
19 END {
20 for (song in count)
21 printf("%d %s\n", count[song], song)
22 }' \
23| sort -n -k 1 -r \
24| head -"$N"
This page took 0.105377 seconds and 4 git commands to generate.