Skip to content

Instantly share code, notes, and snippets.

@hsali
Created November 15, 2016 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsali/91ca50373688cb806ae8831783a75377 to your computer and use it in GitHub Desktop.
Save hsali/91ca50373688cb806ae8831783a75377 to your computer and use it in GitHub Desktop.
Script to select the random file to play video or audio .
#!/bin/bash
if [ "$1" = "" ]; then
echo "no directory defined!"
exit
fi
if [ "$2" = "" ]; then
echo "no file extension defined!"
exit
fi
FILE=$(cd ${1}; find * | grep ${2}$ | shuf -n 1)
PATH="$1$FILE"
/usr/bin/totem "$PATH"
@hsali
Copy link
Author

hsali commented Nov 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment