+ Added bspwm, sxhkd, and polybar
This commit is contained in:
parent
29a1ca8ab2
commit
9a50ab1c1a
14 changed files with 1558 additions and 0 deletions
66
.config/polybar/scripts/pulseaudio-tail.sh
Executable file
66
.config/polybar/scripts/pulseaudio-tail.sh
Executable file
|
@ -0,0 +1,66 @@
|
|||
#!/bin/sh
|
||||
|
||||
update_sink() {
|
||||
sink = alsa_output.pci-0000_00_1b.0.analog-stereo
|
||||
}
|
||||
|
||||
volume_up() {
|
||||
update_sink
|
||||
pactl set-sink-volume "$sink" +1%
|
||||
}
|
||||
|
||||
volume_down() {
|
||||
update_sink
|
||||
pactl set-sink-volume "$sink" -1%
|
||||
}
|
||||
|
||||
volume_mute() {
|
||||
update_sink
|
||||
pactl set-sink-mute "$sink" toggle
|
||||
}
|
||||
|
||||
volume_print() {
|
||||
update_sink
|
||||
|
||||
active_port=$(pacmd list-sinks | sed -n "/index: $sink/,/index:/p" | grep active)
|
||||
if echo "$active_port" | grep -q speaker; then
|
||||
icon="#1"
|
||||
elif echo "$active_port" | grep -q headphones; then
|
||||
icon="#2"
|
||||
else
|
||||
icon="#3"
|
||||
fi
|
||||
|
||||
muted=$(pamixer --sink "$sink" --get-mute)
|
||||
|
||||
if [ "$muted" = true ]; then
|
||||
echo "$icon --"
|
||||
else
|
||||
echo "$icon $(pamixer --sink "$sink" --get-volume)"
|
||||
fi
|
||||
}
|
||||
|
||||
listen() {
|
||||
volume_print
|
||||
|
||||
pactl subscribe | while read -r event; do
|
||||
if echo "$event" | grep -qv "Client"; then
|
||||
volume_print
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--up)
|
||||
volume_up
|
||||
;;
|
||||
--down)
|
||||
volume_down
|
||||
;;
|
||||
--mute)
|
||||
volume_mute
|
||||
;;
|
||||
*)
|
||||
listen
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue