From 8bf195b64b141b67c324af477f41a0c5e0cca229 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 5 Sep 2017 19:09:02 +0200 Subject: [PATCH] shell/+mpd: add mpd-recent-played script --- shell/+mpd/bin/mpd-recent-played | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 shell/+mpd/bin/mpd-recent-played diff --git a/shell/+mpd/bin/mpd-recent-played b/shell/+mpd/bin/mpd-recent-played new file mode 100755 index 00000000..282dab10 --- /dev/null +++ b/shell/+mpd/bin/mpd-recent-played @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Show a list of recently added songs, and the date they were added. This can be +# used to compile a playlist, e.g. +# +# mpc clear +# mpc add $(mpc-recent-played | cut -f2) + +grep played "$HOME/.config/mpd/mpd.log" | sed 's/ : player: played "(.+)"/\t\1/g' | tail -n${1:-20} +