Skip to content

Instantly share code, notes, and snippets.

@djhojd
Created February 10, 2016 11:41
Show Gist options
  • Save djhojd/36ae7d35fb75a76358af to your computer and use it in GitHub Desktop.
Save djhojd/36ae7d35fb75a76358af to your computer and use it in GitHub Desktop.
find mp3/flac, sort by last access time, take top 10, sort random, play
#!/bin/bash
while true; do
find ./ -regex '.*\.\(mp3\|flac\)' -printf '%T+ %p\n' | sort | head -n 10 | sort --random-sort | while read f; do
mplayer -quiet "$f" </dev/tty;
touch "$f";
done
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment