power menu, redshift, polybar

This commit is contained in:
azpsen
2024-01-28 16:37:10 -06:00
parent 89516a6ce1
commit 319b44ecbd
307 changed files with 7642 additions and 5 deletions

View File

@@ -0,0 +1,19 @@
# Script: pipewire-microphone
A script for showing and toggling the mute state of the PipeWire default microphone.
## Dependencies
* pactl (libpulse)
## Module
``` ini
[module/pipewire-microphone]
type = custom/script
exec = $HOME/.config/polybar/polybar-scripts/polybar-scripts/pipewire-microphone/pipewire-microphone.sh
tail = true
click-left = $HOME/.config/polybar/polybar-scripts/polybar-scripts/pipewire-microphone/pipewire-microphone.sh --toggle &
```

View File

@@ -0,0 +1,39 @@
#!/bin/sh
get_mic_default() {
pactl info | awk '/Default Source:/ {print $3}'
}
is_mic_muted() {
pactl get-source-mute "$(get_mic_default)" | awk '{print $2}'
}
get_mic_status() {
if [ "$(is_mic_muted)" = "yes" ]; then
printf "%s\n" "#1"
else
printf "%s\n" "#2"
fi
}
listen() {
get_mic_status
LANG=EN; pactl subscribe | while read -r event; do
if printf "%s\n" "${event}" | grep -qE '(source|server)'; then
get_mic_status
fi
done
}
toggle() {
pactl set-source-mute @DEFAULT_SOURCE@ toggle
}
case "${1}" in
--toggle)
toggle
;;
*)
listen
;;
esac