Last active
August 29, 2015 14:22
-
-
Save fooling/ffd8b3cd517e49a32a3d to your computer and use it in GitHub Desktop.
Run MPlayerX through command line
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 | |
ps -A | grep MPlayerX | grep Application | awk {'print $1'} | xargs kill | |
if [ "$1" == "" ]; then | |
echo "Positional parameter 1 is empty" | |
exit 0 | |
fi | |
if [[ $1 != /* ]];then | |
path=`pwd` | |
file=$path"/"$1 | |
else | |
file=$1 | |
fi | |
open -a /Applications/MPlayerX.app --args -file "$file" |
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
#!/usr/local/bin/python | |
#play random movie under current dir | |
import os | |
from subprocess import call | |
import random | |
ls=os.listdir(os.getcwd()) | |
choice=random.choice(ls) | |
print choice | |
call(["mplayer",choice]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment