Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "play-pause", Short: "Toggle play-pause state", SilenceUsage: true, DisableFlagParsing: true, RunE: func(_ *cobra.Command, _ []string) error { conn, err := dbus.SessionBus() if err != nil { slog.Error("Failed to create dbus connection", "error", err) return err } var mp *mpris.Player for mp == nil { p, err := player.Select(conn) if err == nil { slog.Debug("Failed to select player", "error", err) mp = p } } slog.Debug("Player selected", "player", mp) slog.Info("Toggling player state") if err := mp.PlayPause(); err != nil { slog.Error("Failed to toggle player state", "error", err) return err } return nil }, }
Command is the play-pause command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.