* 2026-03-02 14:29:24+0100, Franco Martelli wrote:

> On 02/03/26 at 08:46, Teemu Likonen wrote:
>> So, the general question is: how could a background root script give
>> a desktop notification for the current / all users?
>
> Have you tried "notify-send"? It is provided by the "fyi" package.

Not that one (before) but those notification daemons tend to require the
same user. So does "fyi":

    $ sudo fyi Title Message
    error: failed to connect: /usr/bin/dbus-launch terminated abnormally
    without any error message

So root can't easily send notifications for other users.

Maybe I'll make my backup script's error messages go to a specific text
file and write a user's systemd path unit that triggers on changes of
that file. The triggered service would print "fyi" notification with
file's content as the message. Something like that.

But a good operating system should have an easy uniform way for any
maintenance task to inform desktop user. Maybe systemd people will come
up with something some day. They are good at thinking of big picture.

-- 
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: DD3B8E8ABD28B98176E6A7CCCC9A5E615FCC1D93
/ old key: 6965F03973F0D4CA22B9410F0F2CAE0E07608462

Attachment: signature.asc
Description: PGP signature

Reply via email to