From 89a4626521ea95a8f397c3a43d30c188adaa0537 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Fri, 15 Oct 2021 01:04:00 +0200 Subject: [PATCH] Add script for setting volume --- bin/volume-set | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/volume-set diff --git a/bin/volume-set b/bin/volume-set new file mode 100755 index 0000000..da36fea --- /dev/null +++ b/bin/volume-set @@ -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 \ No newline at end of file