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:
parent
947c314b60
commit
a70956bb3b
16 changed files with 1287 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue