Comments (12)
Could you try #2049?
from i3status-rust.
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"}],
from i3status-rust.
Thanks a lot for your time and work! I really appreciate it.
from i3status-rust.
Hmm, I don't think that this fixes it, there is no change.
from i3status-rust.
It fixes it for me 😆
Let me add some debug prints...
from i3status-rust.
Is there any way that I could debug it?
from i3status-rust.
Try #2049 with RUST_LOG=sound=debug cargo r >/dev/null
(I mean share the output)
from i3status-rust.
$ 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).
from i3status-rust.
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.
from i3status-rust.
Waaait.
i3status-rust/src/blocks/sound/pulseaudio.rs
Lines 408 to 410 in 6a547db
That should be self.form_factor.as_deref()
. My mistake in 477f505.
from i3status-rust.
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.
from i3status-rust.
Can you test that PR now?
from i3status-rust.
Related Issues (20)
- privacy block ignores webcam HOT 4
- Theme no longer being applied in swaybar after update HOT 4
- new privacy block seems to create some instability when switching on and off display outputs HOT 1
- new privacy block causes i3status-rs to be unstable in some conditions, especially when gamescope and certain games are launched HOT 1
- feature: add `format_alt` and `format_list` to all blocks HOT 3
- Wrong icons in sound block HOT 5
- Upgrading an old configuration to later i3status-rust versions HOT 6
- Typo in GitHub repository About description, "resourcefriendly" should be "resource-friendly"
- How to hide sound blocks for devices that are not present? (bluetooth/USB headsets, etc) HOT 4
- .Xresources color definition import? HOT 2
- Feature: Add support for non sway/i3 wayland compositors HOT 1
- amd_gpu: improve the error when a device does not exist HOT 3
- Implement format_alt for sound block HOT 4
- Battery block not showing battery percentage HOT 1
- eng formatter: support prefixes in the range argument
- `sound`: Make the warning status when muted configurable HOT 2
- Request: DNS information to network block HOT 7
- keyboard_layout span colors HOT 2
- Revert empty battery state to charging when plugged in
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3status-rust.