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) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
+4
-2
@@ -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}%"
|
||||
|
||||
Reference in New Issue
Block a user