#dbus #mpris #ipc

pris

A library for interfacing with players compatible with the MPRIS DBus specification

2 releases

0.1.1 Aug 8, 2022
0.1.0 Jun 12, 2021

#9 in #mpris

Download history 1/week @ 2024-02-14 30/week @ 2024-02-21 24/week @ 2024-02-28 2/week @ 2024-03-06 6/week @ 2024-03-13

63 downloads per month

MIT license

18KB
284 lines

pris

A library for interfacing with MPRIS-compatible players, built in the tokio async runtime.


lib.rs:

This library provides a high-level interface to the MPRIS DBus specification.

It allows both controlling of a player, as well as listening for events and executing callbacks.

A basic player controller

use pris::{self, Player};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a connection to work with
    let conn = pris::get_connection();
    // Get a player under the name "vlc"
    let player = Player::try_new("vlc", &conn).await?;
    // Play/pause the player
    player.play_pause().await?;
}

This crate re-exports Message for use in typing non-closure callbacks.

Dependencies

~8–20MB
~255K SLoC