If a user is logged in without running at least a desktop session, then sendNotificationToUser should fail.
A possible solution is to use write, but this comes with the problem, that the usability of interactive programs could be disrupted, especially programs who uses libncurses. Maybe there is a way to detect such programs before selecting a tty.
If a user is logged in without running at least a desktop session, then sendNotificationToUser should fail.
A possible solution is to use write, but this comes with the problem, that the usability of interactive programs could be disrupted, especially programs who uses libncurses. Maybe there is a way to detect such programs before selecting a tty.