playerctl-rust-wrapper 0.1.0

A Rust implementation of a playerctl wrapper
Documentation
  • Coverage
  • 82.14%
    23 out of 28 items documented11 out of 14 items with examples
  • Size
  • Source code size: 11.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 664.51 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hbacelar8

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