#!/usr/bin/env sh

# Description: Play random music from current directory. Identifies MP3, FLAC, WEBM, WMA.
#              You may want to change the PLAYER.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana

PLAYER=smplayer

find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" "$PLAYER" > /dev/null 2>&1 &
disown