sway_volume: improve notifications
This commit is contained in:
parent
2500644956
commit
0faf3cfcaa
1 changed files with 7 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
||||||
source $HOME/.config/sway/bin/sway_helpers
|
source $HOME/.config/sway/bin/sway_helpers
|
||||||
SINK=$(pactl info | grep "Default Sink" | cut -d ' ' -f 3)
|
SINK=$(pactl info | grep "Default Sink" | cut -d ' ' -f 3)
|
||||||
ICON_PATH=$HOME/.local/share/icons/Tela-circle-dark/16/actions
|
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() {
|
function getProgressString() {
|
||||||
ITEMS="$1" # The total number of items(the width of the bar)
|
ITEMS="$1" # The total number of items(the width of the bar)
|
||||||
|
@ -30,20 +30,20 @@ function notify() {
|
||||||
M=""
|
M=""
|
||||||
if [ "$MUTE" = "yes" ]; then
|
if [ "$MUTE" = "yes" ]; then
|
||||||
ICON=$ICON_PATH/audio-volume-muted.svg
|
ICON=$ICON_PATH/audio-volume-muted.svg
|
||||||
TITLE="Volume ${VOLUME}%"
|
TITLE="${VOLUME}%"
|
||||||
M=""
|
M=""
|
||||||
elif [ $VOLUME -le 33 ]; then
|
elif [ $VOLUME -le 33 ]; then
|
||||||
ICON=$ICON_PATH/audio-volume-low.svg
|
ICON=$ICON_PATH/audio-volume-low.svg
|
||||||
TITLE="Volume ${VOLUME}%"
|
TITLE="${VOLUME}%"
|
||||||
elif [ $VOLUME -le 67 ]; then
|
elif [ $VOLUME -le 67 ]; then
|
||||||
ICON=$ICON_PATH/audio-volume-medium.svg
|
ICON=$ICON_PATH/audio-volume-medium.svg
|
||||||
TITLE="Volume ${VOLUME}%"
|
TITLE="${VOLUME}%"
|
||||||
else
|
else
|
||||||
ICON=$ICON_PATH/audio-volume-high.svg
|
ICON=$ICON_PATH/audio-volume-high.svg
|
||||||
TITLE="Volume ${VOLUME}%"
|
TITLE="${VOLUME}%"
|
||||||
fi
|
fi
|
||||||
# $NOTIFY_APP -i $ICON -a "Volume" "$TEXT"
|
# $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"
|
APP="pavucontrol"
|
||||||
|
|
Loading…
Reference in a new issue