fix(waybar): update media info on both poll and dbus
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 38s
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 38s
This commit is contained in:
parent
0514904196
commit
d13cfb633d
@ -21,11 +21,22 @@ get-album-info() {
|
|||||||
printf '{"class": "%s", "text": "%s"}\n' "${class}" "${text}"
|
printf '{"class": "%s", "text": "%s"}\n' "${class}" "${text}"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
album-info-dbus-update() {
|
||||||
get-album-info
|
|
||||||
while IFS= read -r _; do
|
while IFS= read -r _; do
|
||||||
get-album-info
|
get-album-info
|
||||||
done < <(busctl --user monitor --json=short --match 'interface=org.mpris.MediaPlayer2.Player,type=signal')
|
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
|
main
|
||||||
|
Loading…
Reference in New Issue
Block a user