fix(waybar): update media info on both poll and dbus
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 38s

This commit is contained in:
Price Hiller 2025-01-10 17:12:14 -06:00
parent 0514904196
commit d13cfb633d
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB

View File

@ -21,11 +21,22 @@ get-album-info() {
printf '{"class": "%s", "text": "%s"}\n' "${class}" "${text}"
}
main() {
get-album-info
album-info-dbus-update() {
while IFS= read -r _; do
get-album-info
done < <(busctl --user monitor --json=short --match 'interface=org.mpris.MediaPlayer2.Player,type=signal')
}
album-info-poller() {
while sleep 1; do
get-album-info
done
}
main() {
album-info-dbus-update &
album-info-poller &
wait
}
main