dotfiles/bin/volume-set

19 lines
381 B
Plaintext
Raw Permalink Normal View History

2021-10-14 23:04:00 +00:00
#!/usr/bin/env sh
DEVICE=pulse
NAME=Master
URGENCY=low
EXPIRE=5000
2021-10-14 23:04:00 +00:00
ALSA_CMD="amixer -D $DEVICE"
NOTIFY_CMD="notify-send -u $URGENCY -t $EXPIRE VOLUME "
2021-10-14 23:04:00 +00:00
$ALSA_CMD sset $NAME "$1"
LEVEL=$($ALSA_CMD sget $NAME | awk -F"[][]" '/Left:/ { print $2 }')
notify-send -u $URGENCY \
-h "int:value:$LEVEL" \
-h string:x-dunst-stack-tag:volume_notif \
-t $EXPIRE \
"VOLUME: $LEVEL"