dot/scripts/mpc_add_recent.sh

8 lines
228 B
Bash
Raw Normal View History

2023-11-06 10:51:50 +00:00
#!/bin/sh
# add recently added files to the playlist
2024-04-04 17:04:16 +00:00
count=${1:-25}
2023-11-06 10:51:50 +00:00
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