Created
November 15, 2016 15:14
-
-
Save hsali/91ca50373688cb806ae8831783a75377 to your computer and use it in GitHub Desktop.
Script to select the random file to play video or audio .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
reference :
https://ubuntuforums.org/showthread.php?t=1206069&p=7572542#post7572542