You are not logged in.
Pages: 1
13.04.2011 - Update : IF you have stumbled across this post please check this new one about using a Unix socket which works better http://crunchbanglinux.org/forums/post/112035/#p112035
VLC has plenty of options for using shortcut keys however these only work when the VLC interface has focus. I am not aware of an easy way to control VLC using multimedia key bindings when it does not have focus so I did some searching and found this article:
It's a little bit hackish but it works.
I then created this script:
vi ~/bin/controlvlc.sh#!/bin/bash
case $1 in
next) A="wget -q -t 1 -O - http://127.0.0.1:8080/?control=next" ;;
prev) A="wget -q -t 1 -O - http://127.0.0.1:8080/?control=previous" ;;
play-pause) A="wget -q -t 1 -O - http://127.0.0.1:8080/?control=pause" ;;
stop) A="wget -q -t 1 -O - http://127.0.0.1:8080/?control=stop" ;;
*) echo "Usage: $0 { next | prev | play-pause | stop }" ;;
esac
exec $Achmod +x ~/bin/controlvlc.shOpen VLC.
Go to: Tools > Preferences > Change "Show Settings" to "All" > Interface > Main Inteface > Select "HTTP remote control interface".
Click Save.
Restart VLC.
Add the following to the "<!-- Keybindings for running applications -->" section of Openbox's rc.xml
vi ~/.config/openbox/rc.xml <keybind key="XF86AudioPlay">
<action name="Execute">
<execute>controlvlc.sh play-pause</execute>
</action>
</keybind>
<keybind key="XF86AudioNext">
<action name="Execute">
<execute>controlvlc.sh next</execute>
</action>
</keybind>
<keybind key="XF86AudioStop">
<action name="Execute">
<execute>controlvlc.sh stop</execute>
</action>
</keybind>
<keybind key="XF86AudioPrev">
<action name="Execute">
<execute>controlvlc.sh prev</execute>
</action>
</keybind>Reconfigure Openbox and try your multimedia keys in VLC.
Cheers!
Last edited by jelloir (2011-04-13 12:19:20)
Offline
Nice, let me try this on my box
Have been looking for this for quite a long time..
Thanks for sharing 
Thanks for everything Linux has taught, is teaching, and will teach me...
Offline
mmhhh.. It doesn't work for me 
if I launch vlc in a terminal the output is:
vlc
VLC media player 1.0.6 Goldeneye
[0x8713b08] main interface: creating httpd
[0x8713b08] main interface error: socket bind error (Permission denied)
[0x8713b08] main interface error: socket bind error (Permission denied)
[0x8713b08] main interface error: cannot create socket(s) for HTTP host
[0x8713b08] http interface error: cannot listen on :8080
[0x8713b08] main interface error: no suitable interface module
[0x86588a8] main libvlc error: interface "http,none" initialization failed
[0x86588a8] main libvlc: Esecuzione di vlc con l'interfaccia predefinita. Usa 'cvlc' per utilizzare vlc senza interfaccia.
(<unknown>:21173): Gtk-WARNING **: Impossibile trovare il motore del tema in module_path: «pixmap»,What can i try?
Offline
I solved my problem
I had other instance of vlc: I killed all and now seems to work.
Thanks
Offline
very nice.
eee701 user & other lap/desktops
Offline
Thank you for this.
Offline
Hi,
Thanks to the original poster. I have Statler X64 running and this little routine gives me VLC Multimedia control from my HP DV5 Pavillion - using the "Quickkeys."
Super!
Offline
Um...
I solved this problem by going into the VLC preferences > Hotkeys, double-clicking on the "Global" column of whichever shortcut you want, then pressing the key you want to use
.
Maybe OP had an older version on which this didn't work, but it's still worth mentioning.
Offline
Um...
I solved this problem by going into the VLC preferences > Hotkeys, double-clicking on the "Global" column of whichever shortcut you want, then pressing the key you want to use
.
Maybe OP had an older version on which this didn't work, but it's still worth mentioning.
see original post...
VLC has plenty of options for using shortcut keys however these only work when the VLC interface has focus.
In any case the guide at http://crunchbanglinux.org/forums/post/112035/#p112035 is better to use.
Offline
see original post...
jelloir wrote:VLC has plenty of options for using shortcut keys however these only work when the VLC interface has focus.
No they don't. There are hotkeys, which work when VLC has focus, and "Global Hotkeys", which work even if it's in the background.
Offline
No they don't. There are hotkeys, which work when VLC has focus, and "Global Hotkeys", which work even if it's in the background.
This works in #! Openbox?
Offline
It does in mine.
Offline
^ Doesn't in mine. Just attached a PS/2 keyboard with various multimedia/audio keys. "xev" shows/detects these XF86Audio keys and VLC allows me to allocate them as "global" hotkeys, but pressing them does nothing (whether VLC has focus or not)
I'm referring here to stop, play/pause, next track and previous track; volume up/down and mute work (but this is via the volume control icon/applet I think). Surely we don't need to hack away with the bash scripts in the first post if VLC is detecting the keypresses... ?
Last edited by SabreWolfy (2012-03-10 09:04:11)
• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
Post here indicates this was solved by installed "xfce4-volumed". I installed this and then ran "xfce4-volumed" but nothing changed. Position keys still don't control VLC.
Last edited by SabreWolfy (2012-03-10 09:14:16)
• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
Just in case I wasn't clear before -- pressing the positional XF86Audio keys in VLC to set them as "Global" hot-keys is working...
And "xev" is showing details when I press them. However, pressing them at a later time to actually use them is not working.
• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
Solved.
By. Restarting. VLC.

• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
When "xfce4-volumed" is running though, a cool notification pop-up appears briefly when changing the volume with the XF86Audio keys 
• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
However, when "xfce4-volumed" is running, the hotkeys under the volume icon | Preferences cannot be changed and/or stop working.
• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.