summaryrefslogtreecommitdiff
path: root/local/bin/sb-volume
diff options
context:
space:
mode:
Diffstat (limited to 'local/bin/sb-volume')
-rwxr-xr-xlocal/bin/sb-volume14
1 files changed, 14 insertions, 0 deletions
diff --git a/local/bin/sb-volume b/local/bin/sb-volume
new file mode 100755
index 0000000..0736259
--- /dev/null
+++ b/local/bin/sb-volume
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+_bsd() {
+ sndioctl -n output.level | sed 's/0\.//' | sed 's/.$/%/' | sed 's/\.//'
+}
+
+_linux() {
+ printf "$(pamixer --get-volume)%%\n"
+}
+
+case $(uname) in
+ Linux) _linux ;;
+ *BSD) _bsd ;;
+esac