aboutsummaryrefslogtreecommitdiff
path: root/i3blocks/i3vol.sh
blob: f702656ce714893d032537c2a33a1a71620a4e3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

case $BLOCK_BUTTON in
	1) i3-msg "exec urxvt -e alsamixer" >/dev/null ;;
	3) pgrep -x dunst >/dev/null && notify-send -t 2000 "Click for alsamixer" ;;
esac

vol=$(pactl list sinks | grep Volumen: | awk '{print $5}')
mute=$(pactl list sinks | grep Silencio: | cut -d' ' -f2)
if [ $mute = "no" ]; then
	echo "🔊 $vol"
else
	echo "🔇($vol)"
fi