sway_volume: improve notifications

This commit is contained in:
Konstantin Koslowski 2021-02-24 11:30:20 +01:00
parent 2500644956
commit 0faf3cfcaa

View file

@ -2,7 +2,7 @@
source $HOME/.config/sway/bin/sway_helpers
SINK=$(pactl info | grep "Default Sink" | cut -d ' ' -f 3)
ICON_PATH=$HOME/.local/share/icons/Tela-circle-dark/16/actions
NOTIFY_APP="dunstify -a \"Volume\" -h string:x-dunst-stack-tag:volume"
NOTIFY_APP="dunstify -a volume -h string:x-dunst-stack-tag:volume"
function getProgressString() {
ITEMS="$1" # The total number of items(the width of the bar)
@ -30,20 +30,20 @@ function notify() {
M=""
if [ "$MUTE" = "yes" ]; then
ICON=$ICON_PATH/audio-volume-muted.svg
TITLE="Volume ${VOLUME}%"
TITLE="${VOLUME}%"
M=""
elif [ $VOLUME -le 33 ]; then
ICON=$ICON_PATH/audio-volume-low.svg
TITLE="Volume ${VOLUME}%"
TITLE="${VOLUME}%"
elif [ $VOLUME -le 67 ]; then
ICON=$ICON_PATH/audio-volume-medium.svg
TITLE="Volume ${VOLUME}%"
TITLE="${VOLUME}%"
else
ICON=$ICON_PATH/audio-volume-high.svg
TITLE="Volume ${VOLUME}%"
fi
TITLE="${VOLUME}%"
fi
# $NOTIFY_APP -i $ICON -a "Volume" "$TEXT"
$NOTIFY_APP -i $ICON -a "$TITLE" "[$(getProgressString 15 "$M" " " $VOLUME)]"
$NOTIFY_APP -i $ICON "$TITLE" "[$(getProgressString 15 "$M" " " $VOLUME)]"
}
APP="pavucontrol"