You are not logged in.

#1 2012-03-21 13:06:12

gordoleon
Member
Registered: 2012-02-22
Posts: 12

[SOLVED]mplayer doubt

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

#2 2012-03-21 15:51:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,614
Website

Re: [SOLVED]mplayer doubt

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

#3 2012-03-22 01:03:01

gordoleon
Member
Registered: 2012-02-22
Posts: 12

Re: [SOLVED]mplayer doubt

Thanks Trilby , that does the trick.

Offline

Board footer

Powered by FluxBB