aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/volume
blob: 6e8c689a5c0e422a8dcaaece1e542ffd9553febf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

# Prints the current volume or 🔇 if muted.

case $BLOCK_BUTTON in
	1) setsid -f "$TERMINAL" -e pulsemixer ;;
	2) pamixer -t ; pkill -RTMIN+10 dwmblocks;;
	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 --sink 0 --get-volume)"

if [ "$vol" = "0" ]; then
	echo 󰓄
else
	printf "󰓃 "
	bar "$vol"
fi