Startseite arrow Software arrow Control VLC via global hotkeys (xbindkeys) under Linux
Control VLC via global hotkeys (xbindkeys) under Linux PDF Drucken E-Mail
If you also like VLC but miss global hot keys for linux follow this tutorial. (Tested with Ubuntu but does not need any special features. Just replace apt-get!)
  1. Open up the Terminal
  2. Enter sudo apt-get install xbindkeys
  3. Enter gedit .xbindkeysrc
  4. Enter the following config:
    #Next
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=next"
    m:0x10 + c:171
    Mod2 + XF86AudioNext

    #Prev
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=previous"
    m:0x10 + c:173
    Mod2 + XF86AudioPrev

    #Play-Pause
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=pause"
    m:0x10 + c:172
    Mod2 + XF86AudioPlay

    #Stop
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=stop"
    m:0x10 + c:174
    Mod2 + XF86AudioStop

    #Start
    "vlc"
    m:0x10 + c:179
    Mod2 + XF86Tools
  5. Save and close the editor window
  6. Enter xbindkeys &
  7. You might want to add this to your session. Go to GNOME Menu > System > Preferences > Session and add /usr/bin/xbindkeys to do so.
  8. Open up Videolan (VLC media player)
  9. Go to Preferences > Interface > General > Interface module: http remote control interface and check the box
  10. Click Save
  11. Restart Videolan (VLC)
  12. If the keys are not configured as you like you may use sudo apt-get install xbindkeys-config followed by xbindkeys-config. More information.

Rhythmbox

  1. If you want to extend the control functionality to Rhythmbox create a file with the following content:
    #!/usr/bin/python
    import sys
    import dbus

    # Start dbus
    session_bus = dbus.SessionBus()

    # Connect to player
    proxy_obj = session_bus.get_object(
    'org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Player')

    player = dbus.Interface(proxy_obj, 'org.gnome.Rhythmbox.Player')

    if sys.argv[1] == "1":
    player.next()
    elif sys.argv[1] == "2":
    player.previous()
    elif sys.argv[1] == "3":
    player.playPause(0)
    elif sys.argv[1] == "4":
    if player.getPlaying() != 0:
    player.playPause(0)
  2. Then change your .xbindkeysrc file:
    #Next
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=next; python path_to_the_file.py 1"
    m:0x10 + c:171
    Mod2 + XF86AudioNext

    #Prev
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=previous; python path_to_the_file.py 2"
    m:0x10 + c:173
    Mod2 + XF86AudioPrev

    #Play-Pause
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=pause; python path_to_the_file.py 3"
    m:0x10 + c:172
    Mod2 + XF86AudioPlay

    #Stop
    "wget -q -t 1 -O - http://127.0.0.1:8080/old/?control=stop; python path_to_the_file.py 4"
    m:0x10 + c:174
    Mod2 + XF86AudioStop

    #Start
    "vlc"
    m:0x10 + c:179
    Mod2 + XF86Tools

  3. Replace path_to_the_file with the real path!
  4. Take care: Using this script you control both players. To avoid problems only keep one of the two players open at the same time.
The information provided in this website is provided "as is" with no warranties of any kind, express or implied, including but not limited to: no warranty of merchantability, no warranty of fitness for a particular purpose, and no warranty of non-infringement.
 
Weiter >