From 85ff8ad17c1456dcd9fbb2c27ee07679bc48e7a9 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 12 Jul 2024 11:48:33 +0800 Subject: changes --- dot-config/bspwm/scripts/bspvolume | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'dot-config/bspwm/scripts/bspvolume') diff --git a/dot-config/bspwm/scripts/bspvolume b/dot-config/bspwm/scripts/bspvolume index 716c65b2..78a989a3 100755 --- a/dot-config/bspwm/scripts/bspvolume +++ b/dot-config/bspwm/scripts/bspvolume @@ -1,7 +1,5 @@ #!/usr/bin/env bash -## Script to manage speaker volume on Archcraft. - # Icons iDIR='/usr/share/archcraft/icons/dunst' notify_cmd='dunstify -u low -h string:x-dunst-stack-tag:obvolume' @@ -16,11 +14,11 @@ get_icon() { current="$(get_volume)" if [[ "$current" -eq "0" ]]; then icon="$iDIR/volume-mute.png" - elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then + elif [[ ("$current" -ge "0") && ("$current" -le "40") ]]; then icon="$iDIR/volume-low.png" - elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then + elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then icon="$iDIR/volume-mid.png" - elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then + elif [[ ("$current" -ge "60") ]]; then icon="$iDIR/volume-high.png" fi } @@ -33,13 +31,13 @@ notify_user() { # Increase Volume inc_volume() { [[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute - pulsemixer --max-volume 100 --change-volume +5 & get_icon && notify_user + pulsemixer --change-volume +5 & get_icon && notify_user } # Decrease Volume dec_volume() { [[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute - pulsemixer --max-volume 100 --change-volume -5 & get_icon && notify_user + pulsemixer --change-volume -5 & get_icon && notify_user } # Toggle Mute -- cgit v1.2.3