dot/scripts/mpc_add_recent.sh
2024-04-04 18:04:29 +01:00

7 lines
228 B
Bash
Executable file

#!/bin/sh
# add recently added files to the playlist
count=${1:-25}
cd ~/music
find . -type f -print0 | xargs -0 stat -c"%Y %n" | sort -n | tail -${count} |cut -d' ' -f2- | while read -r line; do mpc insert "${line#./}"; done