Update volume module on headphone (dis)connect

This commit is contained in:
appeasementPolitik 2023-04-23 07:11:24 +00:00 committed by GitHub
parent 77fd62b9f3
commit eb2d312d9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -7,7 +7,7 @@ xrandr --dpi 96 # Set DPI. User may want to use a larger number for larger scre
setbg & # set the background with the `setbg` script setbg & # set the background with the `setbg` script
#xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup #xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & xrdbpid=$! # Uncomment to use Xresources colors/settings on startup
autostart="mpd xcompmgr dunst unclutter pipewire remapd" autostart="mpd xcompmgr dunst unclutter pipewire remapd volumed"
for program in $autostart; do for program in $autostart; do
pidof -sx "$program" || "$program" & pidof -sx "$program" || "$program" &

9
.local/bin/volumed Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
# Update the volume module in the statusbar whenever
# headphones are added or removed.
while :; do
grep -qP -m1 '^jack\/headphone' <(acpi_listen)
pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}"
done