From 57fd648407a233ae62b2c561d902783597274f83 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Wed, 24 Jan 2024 21:40:48 +0100 Subject: Start work on ALSA volume display --- alsa/src/lib.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 alsa/src/lib.rs (limited to 'alsa/src/lib.rs') diff --git a/alsa/src/lib.rs b/alsa/src/lib.rs new file mode 100644 index 0000000..42800c8 --- /dev/null +++ b/alsa/src/lib.rs @@ -0,0 +1,36 @@ +use swaystatus_plugin::*; + +mod config; +mod communication; +mod runnable; + +use config::AlsaVolumeConfig; + +pub struct AlsaVolumePlugin; +impl SwayStatusModule for AlsaVolumePlugin { + fn get_name(&self) -> &str { + "AlsaVolume" + } + fn deserialize_config<'de, 'p>(&'p self, deserializer : &mut (dyn erased_serde::Deserializer + 'de)) -> Result,erased_serde::Error> { + erased_serde::deserialize::(deserializer) + .map(|c| Box::new(c) as Box) + } + fn get_default_config<'p>(&'p self) -> Box { + todo!(); + } + fn print_help(&self) { + println!( +r#"Swaystatus Alsa Volume plugin. + +This is a volume display for ALSA. You can either choose a specific device, mixer and element to display, or just show the default output's volume."# + ); + } +} + +impl AlsaVolumePlugin { + fn new() -> Self { + Self + } +} + +declare_swaystatus_module!(AlsaVolumePlugin, AlsaVolumePlugin::new); -- cgit v1.2.3