DBus-usage
Jump to navigation
Jump to search
The following is a usage example of how to control VLC though DBUS, by simple using dbus-send. This bash script toggles between Play/Pause:
Stopped -> Play
Playing -> Pause
Pause -> Play
#!/bin/bash if [ -z `dbus-send --print-reply --session --dest=org.mpris.vlc /Player org.freedesktop.MediaPlayer.GetStatus | grep "int32 2"` ]; then dbus-send --print-reply --session --dest=org.mpris.vlc /Player org.freedesktop.MediaPlayer.Pause else dbus-send --print-reply --session --dest=org.mpris.vlc /Player org.freedesktop.MediaPlayer.Play fi