dbus

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: EUPL-1.2 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToggleMediaPlayback

func ToggleMediaPlayback(
	ctx context.Context,
	name string,
) error

ToggleMediaPlayback uses the D-Bus session bus to trigger the PlayPause method on org.mpris.MediaPlayer2.Player.

The name should be of the format org.mpris.MediaPlayer2.xxxx where xxx is the music player. For example, to send the command to Spotify: org.mpris.MediaPlayer2.spotify.

For convenience, any name passed that does not begin with org.mpris.MediaPlayer2 will have it prepended.

You can use a D-Bus explorer like D-Feet to look on your session bus and figure out the name. Search for MPRIS. The spec itself can be found here: https://specifications.freedesktop.org/mpris-spec/latest/.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL