diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-05-20 22:07:49 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-05-20 22:07:49 +0200 |
commit | e4411f54539946fe496097429dbaa2c2afb020b4 (patch) | |
tree | 59b305e33ebf6cd550f3d9b5cca67609f56c7fb5 /.local/bin/statusbar/volume | |
parent | 64da307e356513eaa8cee9c1b58e278b1d84673a (diff) |
Add statusbar scripts for Luke
Diffstat (limited to '.local/bin/statusbar/volume')
-rw-r--r-- | .local/bin/statusbar/volume | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.local/bin/statusbar/volume b/.local/bin/statusbar/volume new file mode 100644 index 0000000..61588c3 --- /dev/null +++ b/.local/bin/statusbar/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%" |