From 2619a88fcd94cbd4b2caa719ba926ae0013fb4ec Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Fri, 25 Dec 2020 08:02:50 -0500 Subject: statusbar scripts now with sb- to avoid conflicts update dwmblocks build to avoid errors --- .local/bin/statusbar/sb-volume | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 .local/bin/statusbar/sb-volume (limited to '.local/bin/statusbar/sb-volume') diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume new file mode 100755 index 0000000..61588c3 --- /dev/null +++ b/.local/bin/statusbar/sb-volume @@ -0,0 +1,28 @@ +#!/bin/sh + +# Prints the current volume or 🔇 if muted. + +case $BLOCK_BUTTON in + 1) setsid -f "$TERMINAL" -e pulsemixer ;; + 2) pamixer -t ;; + 4) pamixer --allow-boost -i 1 ;; + 5) pamixer --allow-boost -d 1 ;; + 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. +- Middle click to mute. +- Scroll to change." ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +[ $(pamixer --get-mute) = true ] && echo 🔇 && exit + +vol="$(pamixer --get-volume)" + +if [ "$vol" -gt "70" ]; then + icon="🔊" +elif [ "$vol" -lt "30" ]; then + icon="🔈" +else + icon="🔉" +fi + +echo "$icon$vol%" -- cgit v1.3.1