Skip to content

Commit

Permalink
feat: add appmenus to audio applications
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-grande committed Jul 15, 2024
1 parent a713cef commit 409ac73
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 10 deletions.
1 change: 1 addition & 0 deletions rpm_spec/qusal-sys-audio.spec
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if test "$1" = "1"; then
qubesctl state.apply sys-audio.create
qubesctl --skip-dom0 --targets=tpl-sys-audio state.apply sys-audio.install
qubesctl --skip-dom0 --targets=dvm-sys-audio state.apply sys-audio.configure-dvm
qubesctl state.apply sys-audio.appmenus
elif test "$1" = "2"; then
## Upgrade
true
Expand Down
1 change: 1 addition & 0 deletions rpm_spec/qusal-sys-usb.spec
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ if test "$1" = "1"; then
## Install
qubesctl state.apply sys-usb.create
qubesctl --skip-dom0 --targets=tpl-sys-usb state.apply sys-usb.install
qubesctl state.apply sys-usb.appmenus
elif test "$1" = "2"; then
## Upgrade
true
Expand Down
33 changes: 25 additions & 8 deletions salt/sys-audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Audio operations in Qubes OS.
* [Usage](#usage)
* [Audio control](#audio-control)
* [Client turned off with a device attached](#client-turned-off-with-a-device-attached)
* [How to use USB devices](#how-to-use-usb-devices)
* [How to managed audio input/output devices](#how-to-managed-audio-inputoutput-devices)
* [How to use advanced audio processing capabilities](#how-to-use-advanced-audio-processing-capabilities)
* [How to use Bluetooth](#how-to-use-bluetooth)
* [How to make the Bluetooth icon appear in the system tray](#how-to-make-the-bluetooth-icon-appear-in-the-system-tray)
* [How to attach the Bluetooth controller to the AudioVM persistently](#how-to-attach-the-bluetooth-controller-to-the-audiovm-persistently)
Expand All @@ -29,6 +30,7 @@ the necessary packages for bluetooth with the provided state.
sudo qubesctl top.enable sys-audio
sudo qubesctl --targets=tpl-sys-audio,dvm-sys-audio state.apply
sudo qubesctl top.disable sys-audio
sudo qubesctl state.apply sys-audio.appmenus
```

* State:
Expand All @@ -39,6 +41,7 @@ sudo qubesctl top.disable sys-audio
sudo qubesctl state.apply sys-audio.create
sudo qubesctl --skip-dom0 --targets=tpl-sys-audio state.apply sys-audio.install
sudo qubesctl --skip-dom0 --targets=dvm-sys-audio state.apply sys-audio.configure-dvm
sudo qubesctl state.apply sys-audio.appmenus
```

<!-- pkg:end:post-install -->
Expand All @@ -49,6 +52,13 @@ If you want to autostart the AudioVM on boot, you may run:
sudo qubesctl state.apply sys-audio.autostart
```

To use advanced sound features such as mixing, echo canceller, noise
reduction:

```sh
sudo qubesctl --skip-dom0 --targets=tpl-sys-audio state.apply sys-audio.install-easyeffects
```

If you need Bluetooth support, install the dependencies:

```sh
Expand Down Expand Up @@ -82,18 +92,25 @@ will fail. To be able to use the device again:
* Restart the audio client; and
* Attach the device to the audio client.

### How to use USB devices
### How to managed audio input/output devices

It is possible to connect USB devices to `disp-sys-audio`, just attach the
devices to the AudioVM. Note that attached devices don't take precedence over
built-in audio. To choose which playback and recording device a qube should
use, on `disp-sys-audio`, from the application menu, click on `Volume Control`
or from the terminal, run `pavucontrol`. Select the `Playback` and `Recording`
tab, find your client qube and select the wanted device.
It is possible to connect many types of audio devices to `disp-sys-audio`,
just attach the devices to the AudioVM. Note that attached devices don't take
precedence over built-in audio, happens with USB devices. To choose which
playback and recording device a qube should use, on `disp-sys-audio`, from the
application menu, click on `Volume Control` or from the terminal, run
`pavucontrol`. Select the `Playback` and `Recording` tab, find your client
qube and select the wanted device.

For more information, please refer to the
[usage of sys-usb](../sys-usb/README.md#usage).

### How to use advanced audio processing capabilities

You must run the `install-easyeffects` state as described in the installation
section. Instead of using `Pavucontrol`, use `Easy Effects` for advanced audio
processing capabilities.

### How to use Bluetooth

#### How to make the Bluetooth icon appear in the system tray
Expand Down
8 changes: 8 additions & 0 deletions salt/sys-audio/appmenus.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{% from 'utils/macros/sync-appmenus.sls' import sync_appmenus -%}
{{ sync_appmenus('tpl-' ~ sls_path) }}
10 changes: 10 additions & 0 deletions salt/sys-audio/appmenus.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>

SPDX-License-Identifier: AGPL-3.0-or-later
#}

base:
'dom0':
- match: nodegroup
- sys-audio.appmenus
16 changes: 15 additions & 1 deletion salt/sys-audio/create.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ require:
- sls: {{ slsdotpath }}.clone
prefs:
- audiovm: ""
features:
- set:
# editorconfig-checker-disable
- default-menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
- menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
# editorconfig-checker-enable
{%- endload %}
{{ load(defaults) }}
Expand Down Expand Up @@ -46,10 +52,14 @@ features:
- service.cups-browsed
- service.meminfo-writer
- service.qubes-updates-proxy
- set:
# editorconfig-checker-disable
- menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
# editorconfig-checker-enable
{%- endload %}
{{ load(defaults) }}
{% set audio_pcidevs = salt['grains.get']('pci_audio_devs', []) -%}
{% set audio_pcidevs = salt['grains.get']('pci_audio_devs', []) %}
{% load_yaml as defaults -%}
name: disp-{{ slsdotpath }}
force: True
Expand Down Expand Up @@ -78,6 +88,10 @@ features:
- service.cups-browsed
- service.meminfo-writer
- service.qubes-updates-proxy
- set:
# editorconfig-checker-disable
- menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
# editorconfig-checker-enable
tags:
- add:
- audiovm
Expand Down
2 changes: 1 addition & 1 deletion salt/sys-audio/files/admin/policy/default.policy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023 - 2024 Yukikoo neowutran <https://neowutran.ovh>
# SPDX-FileCopyrightText: 2023 - 2024 Neowutran <https://neowutran.ovh>
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
21 changes: 21 additions & 0 deletions salt/sys-audio/install-easyeffects.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{#
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{% if grains['nodename'] != 'dom0' -%}

include:
- utils.tools.common.update

"{{ slsdotpath }}-easyeffects-installed":
pkg.installed:
- require:
- sls: utils.tools.common.update
- install_recommends: False
- skip_suggestions: True
- pkgs:
- easyeffects

{% endif -%}
10 changes: 10 additions & 0 deletions salt/sys-audio/install-easyeffects.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>

SPDX-License-Identifier: AGPL-3.0-or-later
#}

base:
'tpl-sys-audio':
- match: list
- sys-audio.install-easyeffects
2 changes: 2 additions & 0 deletions salt/sys-usb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ the USB controllers to different qubes is possible.
sudo qubesctl top.enable sys-usb
sudo qubesctl --targets=tpl-sys-usb state.apply
sudo qubesctl top.disable sys-usb
sudo qubesctl state.apply sys-usb.appmenus
```

* State:
Expand All @@ -39,6 +40,7 @@ sudo qubesctl top.disable sys-usb
```sh
sudo qubesctl state.apply sys-usb.create
sudo qubesctl --skip-dom0 --targets=tpl-sys-usb state.apply sys-usb.install
sudo qubesctl state.apply sys-usb.appmenus
```

<!-- pkg:end:post-install -->
Expand Down
8 changes: 8 additions & 0 deletions salt/sys-usb/appmenus.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{% from 'utils/macros/sync-appmenus.sls' import sync_appmenus -%}
{{ sync_appmenus('tpl-' ~ sls_path) }}
10 changes: 10 additions & 0 deletions salt/sys-usb/appmenus.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{#
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <ben.grande.b@gmail.com>

SPDX-License-Identifier: AGPL-3.0-or-later
#}

base:
'dom0':
- match: nodegroup
- sys-usb.appmenus
14 changes: 14 additions & 0 deletions salt/sys-usb/create.sls
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ require:
- sls: {{ slsdotpath }}.clone
prefs:
- audiovm: ""
features:
- set:
# editorconfig-checker-disable
- default-menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
- menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
# editorconfig-checker-enable
{%- endload %}
{{ load(defaults) }}
Expand Down Expand Up @@ -60,6 +66,10 @@ features:
- service.cups-browsed
- service.meminfo-writer
- service.qubes-updates-proxy
- set:
# editorconfig-checker-disable
- menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
# editorconfig-checker-enable
{%- endload %}
{{ load(defaults) }}
Expand Down Expand Up @@ -144,6 +154,10 @@ features:
- service.cups-browsed
- service.meminfo-writer
- service.qubes-updates-proxy
- set:
# editorconfig-checker-disable
- menu-items: "easyeffects.desktop pavucontrol.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204
# editorconfig-checker-enable
tags:
- add:
- usbvm
Expand Down
1 change: 1 addition & 0 deletions salt/sys-usb/files/admin/policy/default.policy
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-FileCopyrightText: 2023 - 2024 Neowutran <https://neowutran.ovh>
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <ben.grande.b@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down

0 comments on commit 409ac73

Please sign in to comment.