From 57aad4d5284bfecfbe8c3d30dd5ae5c65534ac68 Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 6 Nov 2023 10:51:50 +0000 Subject: Update tablet script --- scripts/mpc_add_recent.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/mpc_add_recent.sh (limited to 'scripts/mpc_add_recent.sh') 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 -- cgit v1.2.1