use dnote by default

This commit is contained in:
speedie 2023-02-26 00:15:27 +01:00
parent 87cbcf5343
commit 3b68e7fbf6

View file

@ -8,7 +8,7 @@
# Additionally requires pulsemixer for pulseaudio/pipewire or alsamixer for alsa if the mixer functionality is used # Additionally requires pulsemixer for pulseaudio/pipewire or alsamixer for alsa if the mixer functionality is used
[ -z "$STATUS" ] && STATUS="speedwm_status" [ -z "$STATUS" ] && STATUS="speedwm_status"
[ -z "$NOTIF_SYSTEM" ] && NOTIF_SYSTEM="notify-send" [ -z "$NOTIF_SYSTEM" ] && NOTIF_SYSTEM="dnote"
MUTE() { MUTE() {
# Mute for pulseaudio/pipewire # Mute for pulseaudio/pipewire
@ -21,37 +21,47 @@ MUTE() {
} }
RAISE() { RAISE() {
NOTIFY_VOL() {
[ "$NOTIF_SYSTEM" = "dnote" ] && command -v dnote > /dev/null && printf " %s\n" "$($0 -get_vol)" | dnote -loc 4
[ "$NOTIF_SYSTEM" = "notify-send" ] && command -v notify-send > /dev/null && notify-send " Volume" "$($0 -get_vol)"
}
PULSE() { PULSE() {
command -v pactl > /dev/null && pactl set-sink-volume @DEFAULT_SINK@ +${NUM}% command -v pactl > /dev/null && pactl set-sink-volume @DEFAULT_SINK@ +${NUM}%
command -v notify-send > /dev/null && notify-send " $(pactl get-sink-volume @DEFAULT_SINK@ | awk '{ print $5;exit }')"
} }
ALSA() { ALSA() {
command -v amixer > /dev/null && amixer -c 0 set Master ${NUM}%+ command -v amixer > /dev/null && amixer -c 0 set Master ${NUM}%+
command -v notify-send > /dev/null && notify-send " $(amixer -c 0 get Master | tail -n 1 | sed -r "s/.*\[(.*)%\].*/\1/")%"
} }
[ "$AUDIO" = "pulse" ] && PULSE || ALSA [ "$AUDIO" = "pulse" ] && PULSE || ALSA
pidof "$STATUS" > /dev/null && \ pidof "$STATUS" > /dev/null && \
kill -38 $(pidof $STATUS) kill -38 $(pidof $STATUS)
NOTIFY_VOL
} }
LOWER() { LOWER() {
NOTIFY_VOL() {
[ "$NOTIF_SYSTEM" = "dnote" ] && command -v dnote > /dev/null && printf " %s\n" "$($0 -get_vol)" | dnote -loc 4
[ "$NOTIF_SYSTEM" = "notify-send" ] && command -v notify-send > /dev/null && notify-send " Volume" "$($0 -get_vol)"
}
PULSE() { PULSE() {
command -v pactl > /dev/null && pactl set-sink-volume @DEFAULT_SINK@ -${NUM}% command -v pactl > /dev/null && pactl set-sink-volume @DEFAULT_SINK@ -${NUM}%
command -v notify-send > /dev/null && notify-send " $(pactl get-sink-volume @DEFAULT_SINK@ | awk '{ print $5;exit }')"
} }
ALSA() { ALSA() {
command -v amixer > /dev/null && amixer -c 0 set Master ${NUM}%- command -v amixer > /dev/null && amixer -c 0 set Master ${NUM}%-
command -v notify-send > /dev/null && notify-send " $(amixer -c 0 get Master | tail -n 1 | sed -r "s/.*\[(.*)%\].*/\1/")%"
} }
[ "$AUDIO" = "pulse" ] && PULSE || ALSA [ "$AUDIO" = "pulse" ] && PULSE || ALSA
pidof "$STATUS" > /dev/null && \ pidof "$STATUS" > /dev/null && \
kill -38 $(pidof $STATUS) kill -38 $(pidof $STATUS)
NOTIFY_VOL
} }
GETVOL() { GETVOL() {