Update: Changed scipts, updated readme.

This commit is contained in:
Keyitdev
2022-06-22 19:27:20 +02:00
parent 35c6ea42ec
commit c589d31ace
11 changed files with 208 additions and 163 deletions
+21 -21
View File
@@ -1,44 +1,44 @@
#!/bin/bash
#!/bin/sh
DIR="/usr/local/bin/icons"
dir="/usr/local/bin/icons"
CUR_VOL=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
MUTE=$(pactl list sinks | grep Mute | sed 's/.*Mute: //g' | sed 1q)
cur_vol=$(pactl list sinks | grep '^[[:space:]]Volume:' | \
head -n $(( SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,')
MUTE=$(pacmd list-sinks | awk '/muted/ { print $2 }' | head -1)
affirmative="yes"
negative="no"
VOL_QUIET=33
VOL_LOUD=66
vol_quiet=33
vol_loud=66
if [[ $MUTE = $affirmative ]]; then
if [ "$MUTE" = "$affirmative" ]; then
dunstify -a "Mute" \
"Mute" \
"Muted" \
"Sink is now muted" \
-r 100 \
-i $DIR/volume-x.svg
elif [[ $MUTE = $negative ]]; then
if [ $CUR_VOL -le $VOL_QUIET ]; then
-i "$dir"/volume-x.svg
elif [ "$MUTE" = "$negative" ]; then
if [ "$cur_vol" -le "$vol_quiet" ]; then
dunstify -a "Mute" \
"Mute" \
"Unmuted" \
"Sink is now unmuted" \
-r 100 \
-i $DIR/volume.svg
-i "$dir"/volume.svg
fi
if [ $CUR_VOL -gt $VOL_QUIET ] && [ $CUR_VOL -le $VOL_LOUD ]; then
if [ "$cur_vol" -gt "$vol_quiet" ] && [ "$cur_vol" -le "$vol_loud" ]; then
dunstify -a "Mute" \
"Mute" \
"Unmuted" \
"Sink is now unmuted" \
-r 100 \
-i $DIR/volume-1.svg
-i "$dir"/volume-1.svg
fi
if [ $CUR_VOL -gt $VOL_LOUD ]; then
if [ "$cur_vol" -gt "$vol_loud" ]; then
dunstify -a "Mute" \
"Mute" \
"Unmuted" \
"Sink is now unmuted" \
-r 100 \
-i $DIR/volume-2.svg
-i "$dir"/volume-2.svg
fi
fi
echo $MUTE
echo "$MUTE"