diff --git a/src/homeassistant.rs b/src/homeassistant.rs index 72d73f9..be079ec 100644 --- a/src/homeassistant.rs +++ b/src/homeassistant.rs @@ -427,6 +427,7 @@ impl HomeAssistant { OutputFormat::Waybar => Waybar::builder() .text(text) .percentage((volume_raw * 100.) as u8) + .muted(is_muted) .build() .to_string(), OutputFormat::I3Blocks => I3Blocks::builder().text(text).build().to_string(), diff --git a/src/output/waybar.rs b/src/output/waybar.rs index a488044..ca08869 100644 --- a/src/output/waybar.rs +++ b/src/output/waybar.rs @@ -11,6 +11,7 @@ pub(crate) struct WaybarBuilder { tooltip: String, class: String, percentage: u8, + muted: bool, } impl WaybarBuilder { @@ -43,6 +44,11 @@ impl WaybarBuilder { self } + pub(crate) fn muted(mut self, muted: bool) -> Self { + self.muted = muted; + self + } + pub(crate) fn build(self) -> Waybar { Waybar { text: self.text, @@ -50,6 +56,7 @@ impl WaybarBuilder { tooltip: self.tooltip, class: self.class, percentage: self.percentage, + muted: self.muted } } } @@ -61,6 +68,7 @@ pub(crate) struct Waybar { tooltip: String, class: String, percentage: u8, + muted: bool, } impl Waybar {