blob: cfecfd4757bd2f9d8915fb320ed46fb69a7d2df7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
use swaystatus_plugin::*;
mod runnable;
mod config;
mod communication;
use config::*;
pub struct PulseVolumePlugin;
impl SwayStatusModule for PulseVolumePlugin {
fn get_name(&self) -> &str {
"PulseVolume"
}
fn deserialize_config<'de>(&self, deserializer : &mut (dyn erased_serde::Deserializer + 'de)) -> Result<Box<dyn SwayStatusModuleInstance>, erased_serde::Error> {
let result : PulseVolumeConfig = erased_serde::deserialize(deserializer)?;
Ok(Box::new(result))
}
fn get_default_config(&self) -> Box<dyn SwayStatusModuleInstance> {
let config = PulseVolumeConfig::default();
Box::new(config)
}
fn print_help(&self) {
//TODO!
println!(
r#"Swaystatus Pulseaudio Volume plugin.
Sorry, this help has not been finalized. If this ever gets public, slap Andi."#);
}
}
impl PulseVolumePlugin {
fn new() -> Self {
Self
}
}
declare_swaystatus_module!(PulseVolumePlugin, PulseVolumePlugin::new);
|