diff --git a/README.md b/README.md index 657cb6f..bb4558e 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,19 @@ sudo make install **Transactional Update Notifier** should be run as a user's Systemd unit. -``` bash -transactional-update-notifier daemon +This will wait for messages over dbus at `org.opensuse.tukit.Updated` and trigger the graphical +notification when receiving the signal. + +Graphical notifications are performed using user's dbus session. + +``` console +~$: transactional-update-notifier daemon ``` Or using `systemctl`: -``` bash -systemctl --user enable --now transactional-update-notifier +``` console +~$: systemctl --user enable --now transactional-update-notifier ``` **Note:** After installing **Transactional Update Notifier** using `make`, the @@ -34,14 +39,19 @@ systemctl --user enable --now transactional-update-notifier service by default on next boot and all you needed to do is to start it with: ``` bash -systemctl --user start transactional-update-notifier +~$: systemctl --user start transactional-update-notifier ``` ### Client **Transactional Update Notifier** can be run from anywhere and executed by anyone, -it will find the notifier socket and notify the user. +it will send messages over dbus on `org.opensuse.tukit.Updated` and all listening services +will trigger a graphical notification. -``` bash -transactional-update-notifier client +``` console +~#: transactional-update-notifier client ``` + +Be aware that the file `org.opensuse.tukit.Updated.conf` should be put into `/etc/dbus-1/system.d/` in +order to protect the `org.opensuse.tukit.Updated` name and allow only `root` to emit signals on this +interface. diff --git a/client.go b/client.go index 97cd7d4..7c06af4 100644 --- a/client.go +++ b/client.go @@ -5,9 +5,8 @@ import ( "github.com/godbus/dbus/v5" ) -// NotifyDaemonClient will search througt all files in /run/user, to find all -// running transactionalupdatenotification socket files, then send a message -// to each one of them in order to trigger the notification for all. +// NotifyDaemonClient will emit a message on org.opensuse.tukit.Updated +// so each one of the user-facing service will trigger the graphical notification. func NotifyDaemonClient(success string) { conn, err := dbus.SystemBus() if err != nil { diff --git a/daemon.go b/daemon.go index 048104f..1a5a7a4 100644 --- a/daemon.go +++ b/daemon.go @@ -62,6 +62,8 @@ func notify(input string) { } } +// NotifyDaemon will wait for a message on org.opensuse.tukit.Updated and trigger +// a graphical notification accordingly. func NotifyDaemon() { conn, err := dbus.SystemBus() if err != nil {