Issues with Notification Volumes

Sorry I’m late, kinda forgot about this until I was cleaning up my files and found it.

This is derived from my pipewire config and should help. I updated my rules after this conversation and had more success. It catches just about everything for me, but you might need to alter it to suit your needs. Consider it a work-in-progress, but fully-functional.

TLDR what this does:

  • Creates a virtual sound card called ‘Notifications’ and you get a volume control for it, and can set hard-coded min/max volumes to override the volume control slider (here set to 60% max)
  • The output of the virtual sound card will automatically follow your selected audio device
  • Pipewire, pulse, and JACK client streams which match one of the criteria in the rules, will automatically play their sound into not the device you selected, but into this virtual device. (which then sets the volume and sends it out to the selected device, as above)

Yes, the formatting is weird, it’s for ease of editing, there’s method in my madness. Change it if you like.

I did test this without my usual config in place and it worked but if you have problems let me know.

File contents:
~/.config/pipewire/pipewire.conf.d/60-notifications-volume.conf

# Notifications volume
context.modules = [
    {   name = libpipewire-module-loopback args = {
            capture.props = {
                media.class = Audio/Sink
                media.name = "Notifications"
                node.name = "Notifications"
                node.nick = "Notifications"
                node.description = "Notifications"
                node.passive = true
                node.virtual = false # Special treatment to always show this in volume control
            }
            playback.props = {
                node.name = "Notifications"
                node.description = "Notifications"
                node.linger = true
                node.passive = true
                channelmix.disable  = true
                channelmix.min-volume = 0.0 # Alter these if required
                channelmix.max-volume = 0.60 # Volume will be clamped to these levels
            } } }
]

node.rules = [
    # System notifications
    { matches = [ { media.role = "Notification"
                } { application.id = "~org.kde.*"
                } { application.id = "org.freedesktop.libcanberra"
                } { application.name = "libcanberra"
                } { application.process.binary = "plasmashell"
                } { application.name = "~konsole"
    } ] actions = { update-props = {
        target.object = "Notifications"
    } } }
]
4 Likes