diff --git a/Cargo.toml b/Cargo.toml index a889167..6f9b03d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ license = "GPL-3.0" authors = ["jojii "] repository = "https://github.com/JojiiOfficial/MediaD" description = "A Simple and lightweight daemon to handle keyboard media buttons easily" +readme = "README.md" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 4a99365..a66809e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,15 @@ use mpris::PlayerFinder; use pulsectl::controllers::{DeviceControl, SinkController}; fn main() { + if std::env::args().count() < 2 { + println!( + "Usage: {} ", + std::env::args().nth(0).unwrap_or("mediad".to_owned()) + ); + + return; + } + let device_path = std::env::args().nth(1).unwrap().to_owned(); let mut device = evdev::Device::open(&Path::new("/dev/input/by-id").join(&device_path)).unwrap();