aboutsummaryrefslogtreecommitdiff
path: root/scripts/volume_indicator_deadd
diff options
context:
space:
mode:
authorVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2020-11-08 14:29:30 +0530
committerVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2020-11-08 14:29:30 +0530
commitb4a904bfd4d41bf591181d95166cb8270ca661bc (patch)
treedddd142cf8bee8be278f551c05533884f9329649 /scripts/volume_indicator_deadd
parentf9b768d95b526c730018f4f4d3635e779faedbf7 (diff)
added scripts to pause and unpause popup notifications
Diffstat (limited to 'scripts/volume_indicator_deadd')
-rwxr-xr-xscripts/volume_indicator_deadd35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/volume_indicator_deadd b/scripts/volume_indicator_deadd
new file mode 100755
index 00000000..3f23df24
--- /dev/null
+++ b/scripts/volume_indicator_deadd
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+if [ "$1" == "inc" ]; then
+ amixer -q sset Master 5%+
+fi
+
+if [ "$1" == "dec" ]; then
+ amixer -q sset Master 5%-
+fi
+
+if [ "$1" == "mute" ]; then
+ amixer -q sset Master toggle
+fi
+
+
+AMIXER=$(amixer sget Master)
+VOLUME=$(echo $AMIXER | grep 'Right:' | awk -F'[][]' '{ print $2 }' | tr -d "%")
+MUTE=$(echo $AMIXER | grep -o '\[off\]' | tail -n 1)
+if [ "$VOLUME" -le 20 ]; then
+ ICON=audio-volume-low
+else if [ "$VOLUME" -le 60 ]; then
+ ICON=audio-volume-medium
+ else
+ ICON=audio-volume-high
+ fi
+fi
+if [ "$MUTE" == "[off]" ]; then
+ ICON=audio-volume-muted
+fi
+
+
+
+NOTI_ID=$(notify-send.py "Lautstärke" "$VOLUME/100" \
+ --hint string:image-path:$ICON boolean:transient:true \
+ --replaces-process "volume-popup")