Add script for setting volume

This commit is contained in:
Przemek Grondek 2021-10-15 01:04:00 +02:00
parent 5ea2f82e06
commit 89a4626521

14
bin/volume-set Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env sh
DEVICE=pulse
NAME=Master
URGENCY=low
EXPIRE=1500
ALSA_CMD="amixer -D $DEVICE"
NOTIFY_CMD="notify-send -u $URGENCY -t $EXPIRE 🔊 "
$ALSA_CMD sset $NAME "$1"
LEVEL=$($ALSA_CMD sget $NAME | awk -F"[][]" '/Left:/ { print $2 }')
$NOTIFY_CMD $LEVEL