I am using the borgmatic's hook feature to notify me that a backup started/finished using notify-send:
Code:
sudo -u miguel DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "Borgmatic started" "backup home"
(sudo necessary as borgmatic run as root)
and as user "miguel" I had to disable X access control ("xhost +") to get this working.
It is working but I would like to know/learn if there is another better approach ?
I suspect there is another way, as I saw notifications from updates that are available, notifications that a new disk was plugged/unplugged and many others that I suspect they are generated by system processes (not mine).
Also, I realize this hack works only for user miguel (myself) running X, but would be nice a solution that worked for the current user whatever he/she is running either X or Wayland,....but this is not really important....
Generally speaking, how a root process can notify an user of something happened ?
I am using KDE if that matters.