Skip to content

Instantly share code, notes, and snippets.

@jnbek
Forked from biboudis/dbus.sh
Created June 1, 2017 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnbek/7845bc1976c6b8f5eb52af0b94cad7e7 to your computer and use it in GitHub Desktop.
Save jnbek/7845bc1976c6b8f5eb52af0b94cad7e7 to your computer and use it in GitHub Desktop.
Playing with dbus.
# qdbus lists all service names of services that are running and you can manipulate at the moment.
qdbus
# control dbus
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
# and use --literal if you need to print the reply in plain text
qdbus --literal org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Playlists.ActivatePlaylist /org/mpris/MediaPlayer2/Playlists/20
# there are other interactive tools, like mdbus2 which provides more rich experience
mdbus2 | clementine
# check what happens when you exchange dbus messages with the listening mode
mdbus2 --listen
# or examine supported bus names for clementine
mdbus2 org.mpris.MediaPlayer2.clementine
# and then examine a specific interface that you would like
mdbus2 org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment