Last active
February 10, 2022 09:24
-
-
Save arafatamim/90f5669769f704203e7867d671910db0 to your computer and use it in GitHub Desktop.
MPRIS commands using dbus-send & busctl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# API Reference: https://specifications.freedesktop.org/mpris-spec/2.2/Player_Interface.html | |
# (property) Get volume | |
dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.cmus \ | |
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get \ | |
string:'org.mpris.MediaPlayer2.Player' \ | |
string:'Volume' | |
busctl --user get-property org.mpris.MediaPlayer2.cmus \ | |
/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player Volume | |
# (method) Play/pause track | |
dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.cmus \ | |
/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause | |
busctl --user call org.mpris.MediaPlayer2.cmus \ | |
/org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player PlayPause | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment