summaryrefslogtreecommitdiff
path: root/scripts/mpc_add_recent.sh
blob: e025eb5a51f4b73a85c30caf88efc8c7e41f88e0 (plain)
1
2
3
4
5
6
7
#!/bin/sh
# add recently added files to the playlist

count=${1:-10}

cd ~/music
find . -type f -print0 | xargs -0 stat -c"%Y %n" | sort -n | tail -${count} |cut -d' ' -f2- | while read -r line; do printf "%s\n" "$line" ; mpc insert "${line#./}"; done