1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

feat: add new volume module

This commit is contained in:
Jake Stanger 2023-04-01 13:07:47 +01:00
parent 947c314b60
commit a70956bb3b
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
16 changed files with 1287 additions and 2 deletions

View file

@ -10,6 +10,8 @@ pub mod music;
pub mod system_tray;
#[cfg(feature = "upower")]
pub mod upower;
#[cfg(feature = "volume")]
pub mod volume;
pub mod wayland;
/// Singleton wrapper consisting of
@ -27,6 +29,8 @@ pub struct Clients {
tray: Option<Arc<system_tray::TrayEventReceiver>>,
#[cfg(feature = "upower")]
upower: Option<Arc<zbus::fdo::PropertiesProxy<'static>>>,
#[cfg(feature = "volume")]
volume: Option<Arc<volume::Client>>,
}
impl Clients {
@ -86,6 +90,13 @@ impl Clients {
})
.clone()
}
#[cfg(feature = "volume")]
pub fn volume(&mut self) -> Arc<volume::Client> {
self.volume
.get_or_insert_with(volume::create_client)
.clone()
}
}
/// Types implementing this trait