Skip to content

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

License

Notifications You must be signed in to change notification settings

hbacelar8/playerctl-rust-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages