Audio Control via Keyboard

Hi all,

the “audio” topic in QubesOS is very “specific”. For me it starts with the “audiovm”, goes via “bluetooth headsets” and ends in controlling volume, current sink and source.All these things I had to learn the hard way when starting using QubesOS but am now happy with how it works.

What I would like to show here is my way of adding keyboard control to my audiovm. Basically what I wanted to achieve is:

volume up/down
mute toggle
mic mute toggle
sink selection
source selection (mic)

This is how it looks like:

To achieve that I have added some scripts to dom0 home folder:

Those scripts are responsible for determining the current vm (based on the currently focused window) and then to call the corresponding script within my audiovm. Additionally those are referenced in the global keyboard shortcut configuration.

Additionally I have added these scripts to my audiovm:

Those contain the “real logic” to control audio via pactl.

Not sure if there is an alternative to this or if this is the right way to go, but it works for me and if somebody would like to try it out I can share the scripts that I have build so far.

Feedback welcome!

Without seeing scripts nobody can tell anything.
Personally I don’t need per qube audio control - global control is all I want and need.

For me the control is important because I am using my laptop also for work (with Teams and other tools), and there it is quite handy to switch the inputs/outputs easily and being able to mute/unmute a bluetooth headset with the hardware button.
I can share the scripts if somebody is interested in. Basically the plan was to share this in case somebody is struggling as I did with all the VM bluetooth audio thing :slight_smile:

For global volume control I had recently also published [1].
It can be bound to keys on the terminal via the main application [2] or the window manager of your choice.

[1] qubes-terminal-hotkeys/util/qubes-wpctl at master · 3hhh/qubes-terminal-hotkeys · GitHub
[2] GitHub - 3hhh/qubes-terminal-hotkeys: keyboard efficient VM management for Qubes OS

Looks great, thanks! Will try this one when I have time later this week.