You are not logged in.
Pages: 1
I was wondering if there's a way to force mplayer to run only one instance without a playlist, is there an option I'm missing to force it to replace the file I'm viewing with the one I double click in the file manager instead of opening another instance of the player? I've been searching but couldn't find anything.
Thx in advance.
Last edited by gordoleon (2012-03-22 01:03:33)
Offline
I don't know if there is any method of doing this built in, but it'd be pretty easy to script. Something like the following should do.
myplayer:
#!/bin/bash
[[ $(pgrep mplayer) ]] && killall mplayer
mplayer "$@"
Edit: then have you file manager or what-not run myplayer in place of mplayer.
Edit 2: I suppose the conditional isn't really needed. You could probably even just `alias mplayer='killall mplayer; mplayer'`
Last edited by Trilby (2012-03-21 15:57:51)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Thanks Trilby , that does the trick.
Offline
Pages: 1