playerctl-rust-wrapper

Crates.ioplayerctl-rust-wrapper
lib.rsplayerctl-rust-wrapper
version0.1.0
created_at2025-01-11 00:28:18.505194+00
updated_at2025-01-11 00:28:18.505194+00
descriptionA Rust implementation of a playerctl wrapper
homepage
repositoryhttps://github.com/hbacelar8/playerctl-rust-wrapper
max_upload_size
id1511922
size11,531
H Bacelar (hbacelar8)

documentation

https://docs.rs/playerctl-rust-wrapper

README

Playerctl Rust Wrapper

A Rust implementation for a playerctl wrapper, allowing the control of the active player and current player track.

Example

use playerctl_wrapper::Playerctl;

fn main() {
    // Command the player to play
    Playerctl::play().unwrap();

    // Command the player to pause
    Playerctl::pause().unwrap();

    // Command the player to toggle between play/pause
    Playerctl::play_pause().unwrap();

    // Command the player to seek forward/backward OFFSET in seconds
    Playerctl::position(10.).unwrap();

    // Get metadata information for the current track
    let metadata = Playerctl::metadata().unwrap();

    println!(
        "Title: {}\nAlbum: {}\nArtist: {}\nURL: {}\nLength: {}",
        metadata.title, metadata.album, metadata.artist, metadata.url, metadata.length
    )
}

Author

Henrique BACELAR

Commit count: 6

cargo fmt