You are not logged in.
Pages: 1
Hi,
mplayer is my software of choice for playing music. That's what I would like to do with it: bind some of the xF86 keys to move to the next/previous music -- instead of going to the terminal where mplayer is originally running and use the keys < / > to move between tracks.
However, after some search, I couldn't find a script/command that I could bind to the xF86 keys that allows me to do this. Is there such a command I could use?
Thanks!!
p.s.: since xmonad is my windows manager, I'm using the xmonad configuration file to bind my media keys.
Last edited by falsum (2010-05-08 09:20:48)
Offline
If xmonad lets you run commands on key bindings you can set up an input pipe to mplayer (put input=file=/home/<username>/.mplayer/pipe in your .mplayer/config) and echo commands to that pipe (see mplayer -input cmdlist for the command list). I think pt_step is the command you want here (google).
Offline
Create a pipe
mkfifo mplayer.pipe
start mplayer like so
mplayer -slave -input file=mplayer.pipe
now you can send commands to this fifo, for example:
echo "pt_step 1" > mplayer.pipe
echo "pt_step -1" > mplayer.pipe
for next song/previous song.
Edit: Gah, beaten by snakebite. The dangers of multi-tasking. Oh well...
Last edited by Gusar (2010-03-27 10:52:12)
Offline
Thanks very much for the replies. But for some reason I couldn't get it working though...
Following Gusar's suggestion, I tried to use the command "echo "pt_step 1" > mplayer.pipe " but it didn't work. When I type this command on the command line it hangs without doing anything.
Any ideas of how I can solve this problem?
Thanks!
Offline
Hi again,
I got it working. I've changed something that I though you wouldn't matter: instead of using tilde (~) to indicate the path of mplayer.fifo I used the absolute path. Now it works like a charm.
Do you know why this change matters?
Cheers,
Offline
I got it working. I've changed something that I though you wouldn't matter: instead of using tilde (~) to indicate the path of mplayer.fifo I used the absolute path. Now it works like a charm.
Do you know why this change matters?
It's because of how bash/<insert shell here> handles tildes.
$ echo ~
/home/you
$ foo=~
$ echo $foo
/home/you
$ foo=bar=~
$ echo $foo
bar=~
This trips many people up.
Offline
This isn't exactly related but I thought it may be better than making a new thread.
Is there a way to remap the keys in mplayer? I would like doule click to be full screen and one click to be pause...is there a way to do this?
Offline
Is there a way to remap the keys in mplayer? I would like doule click to be full screen and one click to be pause...is there a way to do this?
Sure. The file is ~/.mplayer/input.conf
For what you want:
MOUSE_BTN0 pause
MOUSE_BTN0_DBL vo_fullscreen
All commands that you see when you type 'mplayer -input cmdlist' can be configured in input.conf to either the mouse or the keyboard.
Offline
Pages: 1