Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Dec 8, 2022
1 parent fc22628 commit 7df3926
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,39 @@ 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
`96-transactional-update-notifier.preset` preset file should enable the unit
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.
5 changes: 2 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7df3926

Please sign in to comment.