Closed alternateved closed 6 months ago
Could you try #2049?
Hmm, I don't think that this fixes it, there is no change.
It fixes it for me :laughing:
Let me add some debug prints...
Is there any way that I could debug it?
Try #2049 with RUST_LOG=sound=debug cargo r >/dev/null
(I mean share the output)
$ RUST_LOG=sound=debug ~/.cargo/bin/i3status-rs
{"version": 1, "click_events": true}
[
[2024-04-23T19:44:21Z DEBUG sound] form_factor = None
[],
[],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" 0% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:44:21Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" 0% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:44:21Z DEBUG sound] form_factor = Some("analog-output-speaker")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:44:29Z DEBUG sound] form_factor = Some("analog-output-speaker")
[2024-04-23T19:44:29Z DEBUG sound] form_factor = Some("analog-output-speaker")
[2024-04-23T19:44:29Z DEBUG sound] form_factor = Some("analog-output-speaker")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:44:29Z DEBUG sound] form_factor = Some("analog-output-speaker")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:44:29Z DEBUG sound] form_factor = Some("headset-hf-output")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:44:29Z DEBUG sound] form_factor = Some("headset-hf-output")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
Weird, we get headset-hf-output
. Let me check wired headphones too (those were BT).
Continuation:
[2024-04-23T19:44:29Z DEBUG sound] form_factor = Some("headset-hf-output")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:45:56Z DEBUG sound] form_factor = Some("analog-output-speaker")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:45:56Z DEBUG sound] form_factor = Some("analog-output-speaker")
[2024-04-23T19:45:56Z DEBUG sound] form_factor = Some("analog-output-speaker")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:45:56Z DEBUG sound] form_factor = Some("analog-output-speaker")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:45:56Z DEBUG sound] form_factor = Some("headset-output")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"31% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:45:56Z DEBUG sound] form_factor = Some("analog-output-speaker")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:46:13Z DEBUG sound] form_factor = Some("analog-output-headphones")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:46:13Z DEBUG sound] form_factor = Some("analog-output-headphones")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T19:46:13Z DEBUG sound] form_factor = Some("analog-output-headphones")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
So analog-output-headphones
would be for wired ones.
That should be self.form_factor.as_deref()
. My mistake in https://github.com/greshake/i3status-rust/commit/477f505d5707a20d3edb0099adb0f3c9be0b2af8.
diff --git a/src/blocks/sound.rs b/src/blocks/sound.rs
index 9ad5e706..f8477ac9 100644
--- a/src/blocks/sound.rs
+++ b/src/blocks/sound.rs
@@ -156,6 +156,8 @@ pub async fn run(config: &Config, api: &CommonApi) -> Result<()> {
// https://docs.rs/libpulse-binding/2.25.0/libpulse_binding/proplist/properties/constant.DEVICE_FORM_FACTOR.html
Some("headset")
| Some("headphone")
+ | Some("headset-hf-output")
+ | Some("analog-output-headphones")
| Some("hands-free")
| Some("portable")
| Some("[Out] Headphones") => true,
That obviously works, but doesn't seem ideal.
Can you test that PR now?
This works great, I've tested with both wireless and wired headphones:
$ RUST_LOG=sound=debug ~/.cargo/bin/i3status-rs
{"version": 1, "click_events": true}
[
[2024-04-23T20:01:13Z DEBUG sound] form_factor = None
[],
[],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" 0% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:13Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" 0% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:13Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:24Z DEBUG sound] form_factor = None
[2024-04-23T20:01:24Z DEBUG sound] form_factor = None
[2024-04-23T20:01:24Z DEBUG sound] form_factor = None
[2024-04-23T20:01:24Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:24Z DEBUG sound] form_factor = Some("headset")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:32Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:32Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:32Z DEBUG sound] form_factor = None
[2024-04-23T20:01:32Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:32Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:32Z DEBUG sound] form_factor = Some("headset")
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"31% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:32Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:48Z DEBUG sound] form_factor = None
[2024-04-23T20:01:48Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:01:48Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"40% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:02:00Z DEBUG sound] form_factor = None
[2024-04-23T20:02:00Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[2024-04-23T20:02:00Z DEBUG sound] form_factor = None
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
[{"full_text":" ","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"75% ","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
Thanks a lot for your time and work! I really appreciate it.
Hello!
When migrating from waybar to swaybar with i3status-rust, I've noticed a small issue with sound block. Even though
headphones_indicator
is set totrue
icon does not change.I tried that with both bluetooth headphones and wired ones. I'm using Fedora with PipeWire.
Configuration used:
A comparison between waybar (top) and swaybar (bottom) with i3status-rust