From 2e168053c6dc30b184fb7a91f3a17e7fcb5ddb1c Mon Sep 17 00:00:00 2001 From: funman300 Date: Thu, 16 Jul 2026 08:48:41 -0700 Subject: [PATCH] volume: keep the OSD visible in gamemode and fullscreen Two effects were hiding the volume slider: - gamemode-session turns on mako's do-not-disturb mode, whose invisible=1 suppressed every notification, the OSD included. - niri draws fullscreen windows above the top layer, mako's default, so the OSD rendered underneath fullscreen windows even outside gamemode. Tag the OSD with its own app name so mako can match it, then exempt just that name: invisible=0 to survive DND, layer=overlay to clear fullscreen. The block is listed after [mode=do-not-disturb] because later criteria win in mako. Verified with DND active and a fullscreen window: the OSD shows, while another app's notification under the same conditions stays suppressed. Co-Authored-By: Claude Opus 4.8 (1M context) --- mako/config | 7 +++++++ scripts/volume.sh | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mako/config b/mako/config index 2587d6d..9be34d8 100644 --- a/mako/config +++ b/mako/config @@ -6,3 +6,10 @@ default-timeout=4000 [mode=do-not-disturb] invisible=1 + +# The volume OSD must survive both gamemode effects: DND (which gamemode-session +# turns on) would hide it, and niri draws fullscreen windows above the top layer. +# Listed after [mode=do-not-disturb] so it wins over invisible=1. +[app-name=volume-osd] +invisible=0 +layer=overlay diff --git a/scripts/volume.sh b/scripts/volume.sh index 8e4d9c7..12e26c4 100755 --- a/scripts/volume.sh +++ b/scripts/volume.sh @@ -8,13 +8,15 @@ case "${1:-}" in esac if [ "$(pamixer --get-mute)" = "true" ]; then - notify-send -h string:x-canonical-private-synchronous:volume \ + notify-send -a volume-osd \ + -h string:x-canonical-private-synchronous:volume \ -h int:value:0 \ -t 1500 \ "Muted" else LEVEL=$(pamixer --get-volume) - notify-send -h string:x-canonical-private-synchronous:volume \ + notify-send -a volume-osd \ + -h string:x-canonical-private-synchronous:volume \ -h int:value:"$LEVEL" \ -t 1500 \ "Volume: ${LEVEL}%"