Files
dotfiles/scripts/volume.sh
T
funman300 2e168053c6 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>
2026-07-16 08:48:41 -07:00

24 lines
638 B
Bash
Executable File

#!/bin/bash
case "${1:-}" in
up) pamixer -i 5 ;;
down) pamixer -d 5 ;;
mute) pamixer -t ;;
*) echo "usage: $0 up|down|mute" >&2; exit 1 ;;
esac
if [ "$(pamixer --get-mute)" = "true" ]; then
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 -a volume-osd \
-h string:x-canonical-private-synchronous:volume \
-h int:value:"$LEVEL" \
-t 1500 \
"Volume: ${LEVEL}%"
fi