audio-switcher
audio-switcher copied to clipboard
hide text when only one device is available
it would be great if this extension only showed the dropdown menu with the name of the current input and output devices if there was actually more than one to choose from. that way, the visual clutter is minimal when using my laptop as-is, while making it easy to switch to another input/output device when i plug into a dock or external microphone.
Hi wbolster, I think that the message "No more devices" it's a great way to know that the extension is working correctly, but You can try this extension.js, if You want that no message appears instead.
If more people want this feature, I will push to the master branch.
thanks!
the aggregate dropdown menu in the top bar is quite minimalistic (as is gnome-shell in general), and that's a good thing.
this extension breaks that minimalism by showing useless (and oddly aligned) strings like "built-in audio device" which don't help the user. determining whether the extension is working should not be done by inspecting visual clutter ;)
this extension is great, but it only makes sense when there are actually multiple audio devices available (e.g. usb audio in docking station or hdmi). so i fail to see why the list is always shown if i can't do anything with it anyway. if i really want to tweak audio settings, that's what the audio settings preference panel in gnome control center is for.
or am i missing any use cases?
Very good point @wbolster , I will change it soon as possible for me.
showing useless (and oddly aligned) strings like "built-in audio device" What do You mean with "oddly aligned"?
Thanks for your contribution!
awesome. again, thanks for this very useful extension. i use it pretty much every day.
together with my very young work-in-progress "nothing to say" shell extension (https://github.com/wbolster/nothing-to-say) this solves all my everyday audio annoyances on gnome!
oh, about "oddly aligned": the text is not aligned with other items in the menu, like the wifi network name.
Any update on this? The drop-down menu ist still shown when only a single input/output device is present (It just says No more devices
) with latest version of the extension on Ubuntu 20.04 (GNOME 3.36.1). Auto-hiding in such case would be awesome.
I'm still looking for help for these features (as I'm not a extensions developer and this is not really my code) but I'll try to do it in this week, wish me luck :smile:
It's done! Can you check if the change has the desired behaviour @wbolster @salim-b?
It's in the branch hide_text_when_only_one_device
, I'll really appreciate your feedback in this guys :)
You can check the changes doing a simple git checkout
in ~/.local/share/gnome-shell/extensions/audio-switcher@AndresCidoncha/
and reloading the gnome shell ctrl+f2
and type r
.
It's done! Can you check if the change has the desired behaviour @wbolster @salim-b?
Thanks a lot! Works like a charm for me so far 👍
Update: Unfortunately, https://github.com/AndresCidoncha/audio-switcher/commit/59a7c78c3ebe62ec841bdd59e684b917db52339e introduces a regression with suspend/resume- My findings so far:
-
If multiple input or output devices are connected and you put your computer to supend mode, the input/output device selector will be "frozen" (click does nothing) after resume. It stays that way until you either
- disconnect an input/output device,
- restart GNOME Shell
- or change the input/output device via GNOME settings.
-
If only one input or output device is connected and you put your computer to supend mode, the input/output device selector will show up in "frozen" state after resume (although still only one input/output device is connected). It stays that way until you either
- restart GNOME Shell
- or connect another input/output device.
If only one input or output device is connected and you put your computer to suspend mode, the input/output device selector will show up in "frozen" state after resume
About that, if you only have 1 input/output device, you shouldn't see the device selector 🤔
I'll try to reproduce and find the problem but I guess that's the reason the original author used the open-state
signal to reload the list.
About that, if you only have 1 input/output device, you shouldn't see the device selector :thinking:
Yeah, exactly. Before suspend, the device selector wasn't there (expected behaviour) but after resume it suddenly is (unexpected behaviour, and it's in "frozen" state).
I think that's fixed, can you check it too @salim-b ? I added a new commit in the hide_text_when_only_one_device
branch
I think that's fixed, can you check it too @salim-b ? I added a new commit in the
hide_text_when_only_one_device
branch
I've checked it out. The device selector doesn't freeze anymore but your changes introduce new regressions: :grimacing:
-
The input selector doesn't work anymore. Although the dropdown works, the input device isn't actually switched when a different device is selected.
-
After a reboot, the device selectors are hidden although multiple input/output devices are connected. The selector shows up again when I a) reconnect an audio device, b) restart GNOME Shell or c) change the audio device through GNOME settings.
Fix 1, break 2... maybe it's not my day after all 😂 I saw the second bug and I'm trying to fix it, but I didn't notice about the first one, thank you! I hope I'll fix them this week
Fixed the first bug, I forgot to change a line :sweat_smile: Working in the other bug
About the second bug:
With USB headset connected (+ default laptop speakers), when I turn on the computer, looks like in the moment the extension is loaded, the get_sinks
method only returns 1 device (default speakers) but when the USB headset is detected by the system, the output-added
signal isn't detected.
Maybe I should keep using the state-open
signal to avoid this problem.
I don't know about the GNOME API / methods. But I just discovered an alternative extension named Sound Input & Output Device Chooser which works fine so far, optionally allows to hide the input selector when only one device is connected and even shows the different profiles per device. Maybe you can have a look at its sources to see how they do it. Or even join development forces! 🙃
You're right @salim-b, join forces could be the best to do. Anyway, I'll fix these errors first and release the new version.