dotfiles

My dotfiles used for LARBS
Log | Files | Refs | README | LICENSE

commit 09632e19ce560ebd9ea968c7170eadd8e7555e71
parent 24325dd124dc31924fd1f995fcb78cc8f3bf5c08
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sat, 23 Nov 2019 23:37:40 -0500

volume module switched to alsa

Diffstat:
M.local/bin/statusbar/volume | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume @@ -1,18 +1,20 @@ #!/usr/bin/env sh case $BLOCK_BUTTON in - 1) setsid "$TERMINAL" -e pulsemixer & ;; - 2) pulsemixer --toggle-mute ;; - 4) pulsemixer --change-volume +5 ;; - 5) pulsemixer --change-volume -5 ;; + 1) setsid "$TERMINAL" -e alsamixer & ;; + 2) amixer sset Master toggle ;; + 4) amixer sset Master 5%+ ;; + 5) amixer sset Master 5%- ;; 3) pgrep -x dunst >/dev/null && notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted. - Middle click to mute. - Scroll to change." esac -[ "$(pulsemixer --get-mute)" = "1" ] && printf "🔇\\n" && exit +volstat="$(amixer get Master)" -vol=$(pulsemixer --get-volume | awk '{print $1}') +echo "$volstat" | grep "\[off\]" >/dev/null && printf "🔇\\n" && exit + +vol=$(echo "$volstat" | grep -o "\[[0-9]\+%\]" | sed 's/[^0-9]*//g') if [ "$vol" -gt "70" ]; then icon="🔊"