#!/bin/sh pgrep -c pulse && { # printf "Caught pulseaudio (or pipewire-pulseaudio)\n" defsink=$(pactl get-default-sink) case $1 in raise) pactl set-sink-volume @DEFAULT_SINK@ "+${2}%" ;; lower) pactl set-sink-volume @DEFAULT_SINK@ "-${2}%" ;; toggle_mute) pactl set-sink-mute @DEFAULT_SINK@ toggle msg=$(pactl get-sink-mute @DEFAULT_SINK@) notify-send -h 'string:synchronous:volume' "$msg" exit ;; esac msg=$(pactl get-sink-volume @DEFAULT_SINK@|awk '{print $5}') notify-send -h 'string:synchronous:volume' "$msg" #notify-send -h "int:value:$curvol" # progress bar in notification exit } case $1 in raise) amixer set Master "${2}%+" ;; lower) amixer set Master "${2}%-" ;; esac curvol=$(amixer get Master | sed -rn 's/.*\[([0-9]+%)\].*/\1/p') notify-send -h 'string:synchronous:volume' "Volume: $curvol"