Wall broadcaster: forward wall messages to Desktop users
Intro
With the deprecation of utmp in favour of the Y2038-compatible systemd-logind
, one problem remained: desktop environments do not display wall
messages. Historically, xterm
and similar graphical terminals would write a fake entry to the utmp database, and wall would send the message to that TTY. This resulted in users with many open terminals being flooded with these messages, while users who weren’t running a terminal didn’t receive the message at all. The same was true for users of, for example, gnome-terminal, which never did this. Some desktop environments, such as KDE, have a daemon that creates its own fake utmp entry to solve this problem. However, even this no longer works with systemd-logind, since this service does not allow fake entries.
Solution
The wall-broadcaster
utility solves this issue. It opens a PTY and registers itself with systemd-logind
as a new session using that TTY. It monitors the TTY for messages and tries to parse them. Messages sent using wall or write are split into a summary and the main body and cleaned up, else the message will be forwarded as “main body”. The information is then sent via the org.opensuse.WallBroadcast D-Bus interface.
Additonally wall-broadcaster will listen on a varlink interface for messages, which can be sent using, for example, wall-bcst-send
.
The notification components are very similar to the Freedesktop Notifications Specification to make it easy to convert it to the desktop notification system.
Installation and Enablement
System service
The wall-broadcaster.service needs to be started at system up time. There is one instance running for the whole system.
sudo systemctl enable --now wall-broadcaster.service
User gateway
The wall-bcst-gateway
listens to org.opensuse.WallBroadcast and forwards messages as Freedesktop Notification to the user session D-Bus of the Desktop Environment. It needs to be started by the user at login time.
There is a systemd user service wall-bcst-gateway.service, which should be enabled and started during the first login:
systemctl --user enable --now wall-bcst-gateway.service
Systemd will automatically stop the service if the last user session quits.
Sources and Specifications
Sources
The sources can be found at github . Binary RPMs are available for openSUSE Tumbleweed .
The D-Bus Interface
- Path: /org/opensuse/WallBroadcast
- Interface: org.opensuse.WallBroadcast
| Name | Type | Description |
|---|---|---|
| Application Name | String(s) | Optional name of the application sending the notification |
| Summary | String(s) | Single line overview |
| Body | String(s) | Multi-line text |
| Urgency | Byte(y) | 0=Low, 1=Normal, 2=Critical |
| Sender | String(s) | Optional name of the sender |
