From a0ec345229e272af847b7c12213dab5f6829dfab Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Sep 2024 13:46:20 +0800 Subject: added oneline for pipe(remember to redirect stderr -> stdout) and updates --- hyprvol | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'hyprvol') diff --git a/hyprvol b/hyprvol index 326bce7..3980fe7 100755 --- a/hyprvol +++ b/hyprvol @@ -2,7 +2,7 @@ # Icons iDIR='/usr/share/archcraft/icons/dunst' -notify_cmd='notify-send -u low' +# notify_cmd='notify-send -u low' # replace via syshud # Get Volume get_volume() { @@ -22,7 +22,7 @@ notify_user() { icon="$iDIR/volume-high.png" fi if $($HOME/scripts/sysutil.sh getSound screenshot); then $HOME/scripts/sysutil.sh playSound audio-volume-change.oga & fi - ${notify_cmd} -i "$icon" "Volume : $current%" + # ${notify_cmd} -i "$icon" "Volume : $current%" } # Increase Volume @@ -40,19 +40,19 @@ dec_volume() { # Toggle Mute toggle_mute() { if [[ `pulsemixer --get-mute` == 0 ]]; then - wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle & ${notify_cmd} -i "$iDIR/volume-mute.png" "Mute" + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # & ${notify_cmd} -i "$iDIR/volume-mute.png" "Mute" else - current="$(get_volume)" - if [[ "$current" -eq "0" ]]; then - icon="$iDIR/volume-mute.png" - elif [[ ("$current" -ge "0") && ("$current" -le "40") ]]; then - icon="$iDIR/volume-low.png" - elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then - icon="$iDIR/volume-mid.png" - elif [[ ("$current" -ge "60") ]]; then - icon="$iDIR/volume-high.png" - fi - pulsemixer --toggle-mute & ${notify_cmd} -i "$icon" "Unmute" + # current="$(get_volume)" + # if [[ "$current" -eq "0" ]]; then + # icon="$iDIR/volume-mute.png" + # elif [[ ("$current" -ge "0") && ("$current" -le "40") ]]; then + # icon="$iDIR/volume-low.png" + # elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then + # icon="$iDIR/volume-mid.png" + # elif [[ ("$current" -ge "60") ]]; then + # icon="$iDIR/volume-high.png" + # fi + pulsemixer --toggle-mute # & ${notify_cmd} -i "$icon" "Unmute" fi } -- cgit v1.2.3