Как запустить скрипт на сигнале dbus?

1 ответ

Вам нужно dbus-monitor

Сценарий посмотрит что-то как

#!/bin/bash

interface=org.gnome.Rhythmbox.Player
member=playingUriChanged

# listen for playingUriChanged DBus events,
# each time we enter the loop, we just got an event
# so handle the event, e.g. by printing the artist and title
# see rhythmbox-client --print-playing-format for more output options

dbus-monitor --profile "interface='$interface',member='$member'" |
while read -r line; do
    printf "Now playing: "
    rhythmbox-client --print-playing
done

Взятый от https://stackoverflow.com/a/5345462/854477

15
ответ дан 13 April 2017 в 15:24

Другие вопросы по тегам:

Похожие вопросы: