3

I enabled vlc dbus interface:

Is there a way to control VLC from the Sound Menu?

VLC now appears in the sound menu and the controls work.

However, the keyboard shortcuts configured for the media player (System Settings -> Keyboard -> Shortcuts -> Sound and Media) for Play, "Next Track" and "previous track" aren't working. They work fine with banshee.

2 Answers2

1

Your command in comments seems fine. Best way to set, if using compiz, is in ccsm > Commands. (you also need to have the dbus plugin enabled.

Then for command enter as commented dbus-send --type=method_call --print-reply --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

Enable it to the media key in the key bindings as seen in screen, here it's run command 2, when going to the set 'key combo', I just used the media play/pause on keyboard, ie. no combo

enter image description here

doug
  • 17,212
0

ASAIT, VLC cannot be bind to System Audio shortcuts like Rhythmbox or Banshee or Totem. It has its own HOTKEYS interface. The only way I found is the Playlist Hotkeys thing:

  • Press N for Next audio/video track
  • Press P for Previous audio/video track
  • Press SPACE to pause/play track
  • Press S to stop track.

Though, the VLC Window should be active in order for the hotkeys to be active too.

And D-BUS triggering:

Play/Pause Track command:

dbus-send --type=method_call --print-reply --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

Stop Playing command:

dbus-send --type=method_call --print-reply --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop

Next Track command:

dbus-send --type=method_call --print-reply --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

Previous Track command:

dbus-send --type=method_call --print-reply --dest=org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous

VlC Dbus commands added as shorcuts in Unity launcher for VLC entry (using Ubuntu Tweak

sudo add-apt-repository ppa:tualatrix/next
sudo apt-get update
sudo apt-get install ubuntu-tweak

)

VLC Custom Shortcuts in Unity Launcher

VLC Hotkeys

VLC Hotkeys

If you try to bind the Multimedia Bios/System keyboard keys to VLC you'd get either a conflict or the latter would be overwritten/lost. That's my case. For the time being, spot some free keyboard shortcuts and bind them to vlc mpris/vlc methods.

Hanynowsky
  • 2,801