summaryrefslogtreecommitdiff
path: root/bar/volume
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2021-09-11 00:36:13 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2021-09-11 00:36:13 -0500
commit0a9053c2902adab8b94eaacdb15390441143078c (patch)
tree1f1a38272dbd554cde8cdec263187112b9c6a7e8 /bar/volume
downloadscripts-0a9053c2902adab8b94eaacdb15390441143078c.tar.xz
scripts-0a9053c2902adab8b94eaacdb15390441143078c.zip
redid repo cus of fucking chromium rip old commit messages
Diffstat (limited to 'bar/volume')
-rwxr-xr-xbar/volume27
1 files changed, 27 insertions, 0 deletions
diff --git a/bar/volume b/bar/volume
new file mode 100755
index 0000000..2eb9250
--- /dev/null
+++ b/bar/volume
@@ -0,0 +1,27 @@
+#!/usr/bin/awk -f
+
+BEGIN {
+cmd="amixer -M sget Master"
+FS="[][]"
+while (cmd | getline) {
+ if (NF > 1) {
+ vol=int($2)
+ if ($6 == "off")
+ icon="񂁳"
+ else if (vol > 70)
+ icon="񂁲"
+ else if (vol > 40)
+ icon="񂁱"
+ else if (vol > 10)
+ icon="񂁰"
+ else
+ icon="񂁯"
+ #printf "%s %s | %05.2fdB", icon, $2, $4
+ print icon" "$2" | "$4
+ }
+}
+}
+
+##!/bin/sh
+##amixer sget Master | awk -F'[][]' '/%/{print $2" | "$4 " [" $6 "]"}'
+#amixer -M sget Master | sed -n 's/.*Playback [0-9]* \[//; s/. ./ | /; s/\] .off\]/ \[mute\]/p; s/\] .on.//p'