dotfiles/.local/scripts/volumenotify.fish

14 lines
355 B
Fish
Raw Normal View History

#!/usr/bin/env fish
set volume (string match -r '[0-9]+.[0-9]+' (wpctl get-volume @DEFAULT_AUDIO_SINK@))
set volume (math --scale 0 --scale-mode round "$volume * 100")
2026-03-16 19:35:45 +01:00
if string match '*[MUTED]' (wpctl get-volume @DEFAULT_AUDIO_SINK@)
set text "muted"
else
set text "$volume%"
end
notify-send -c 'status' -h int:value:$volume "Volume" "$text"