summaryrefslogtreecommitdiff
path: root/scripts/mpc_add_recent.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-11-06 10:51:50 +0000
committerdavidovski <david@davidovski.xyz>2023-11-06 10:51:50 +0000
commit57aad4d5284bfecfbe8c3d30dd5ae5c65534ac68 (patch)
tree809702e5292a14449b18c5894f1d5a5df824f92c /scripts/mpc_add_recent.sh
parent42984d6686db60a392a66934144e480f72597e72 (diff)
Update tablet script
Diffstat (limited to 'scripts/mpc_add_recent.sh')
-rwxr-xr-xscripts/mpc_add_recent.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/mpc_add_recent.sh b/scripts/mpc_add_recent.sh
new file mode 100755
index 0000000..7465e0e
--- /dev/null
+++ b/scripts/mpc_add_recent.sh
@@ -0,0 +1,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 mpc insert "${line#./}"; done