Created
July 10, 2024 08:05
-
-
Save cretingame/e5d1f07bb7eb549122ad9d3e74969d43 to your computer and use it in GitHub Desktop.
Basic spotify commands through debus using dbus-send
This file contains hidden or 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
| #!/bin/bash | |
| # Basic spotify commands through dbus using dbus-send | |
| # https://community.spotify.com/t5/Desktop-Linux/Basic-controls-via-command-line/m-p/4360856#M15590 | |
| # https://gist.github.com/wandernauta/6800547 | |
| pause() { | |
| dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause | |
| } | |
| play() { | |
| dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play | |
| } | |
| toggle() { | |
| dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause | |
| } | |
| previous() { | |
| dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous | |
| } | |
| next() { | |
| dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment