From ac067ff89e7318d3ab65626d9a2701f09ef959f3 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Thu, 28 Dec 2023 13:38:46 -0500 Subject: volumectl uses pipewire and dwmblocks eselect news --- .local/bin/volumectl | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to '.local/bin/volumectl') diff --git a/.local/bin/volumectl b/.local/bin/volumectl index d8766b7..4f4bc6b 100755 --- a/.local/bin/volumectl +++ b/.local/bin/volumectl @@ -10,14 +10,12 @@ # If no second argument is given, the audio will be SET # to a set percentage fixed by the first argument. case "$1" in - mute) amixer set Master toggle ;; - *) pcnt="$1" - sign="$2" - amixer set Master $pcnt%$sign ;; +mute) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;; +*) + pcnt="$1" + sign="$2" + wpctl set-volume @DEFAULT_AUDIO_SINK@ "$pcnt%$sign" + ;; esac -mute="" -vol=$(awk '/%/ {gsub(/[\[\]]/,""); print $4}' <(amixer sget Master)) -amixer sget Master | grep off && mute="(muted)" -notify-send.sh -t 1000 --replace-file /tmp/vol-notif -a Volume "$vol $mute" - +notify-send.sh -t 1000 --replace-file /tmp/vol-notif -a $(wpctl get-volume @DEFAULT_AUDIO_SINK@) -- cgit v1.2.3