aboutsummaryrefslogtreecommitdiff
path: root/eww/scripts/getvol
diff options
context:
space:
mode:
authoreric.marin <maarin.eric@gmail.com>2024-09-11 14:49:39 +0200
committereric.marin <maarin.eric@gmail.com>2024-09-11 14:59:47 +0200
commit9f20c1f313e20102dd83adeaf091284be1fd82d0 (patch)
treed3db386875af532f4fc55c275312c7c787e88f55 /eww/scripts/getvol
downloaddotfiles-9f20c1f313e20102dd83adeaf091284be1fd82d0.tar.gz
dotfiles-9f20c1f313e20102dd83adeaf091284be1fd82d0.zip
config
Diffstat (limited to 'eww/scripts/getvol')
-rwxr-xr-xeww/scripts/getvol12
1 files changed, 12 insertions, 0 deletions
diff --git a/eww/scripts/getvol b/eww/scripts/getvol
new file mode 100755
index 0000000..4e4275d
--- /dev/null
+++ b/eww/scripts/getvol
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if command -v pamixer &>/dev/null; then
+ if [ true == $(pamixer --get-mute) ]; then
+ echo 0
+ exit
+ else
+ pamixer --get-volume
+ fi
+else
+ amixer -D pulse sget Master | awk -F '[^0-9]+' '/Left:/{print $3}'
+fi