P
P
protasovmikhail2019-06-03 21:58:30
ubuntu
protasovmikhail, 2019-06-03 21:58:30

How to issue notification as root in ubuntu 18.04?

Hello, my task is that after the sleep mode, the script from /lib/systemd/system-sleep/script is doing the work.
It is advisable to issue notifications in this case.
I've tried using zenity and notify-send
but they just don't work.
I tried su user -c "command" for notify-send.
When I try to test the script with sudo, everything works.
zenity swears at the absence of something.
I also tried DISPLAY=:0.0 comand - as recommended for cron cases, but that doesn't help either.
Tell me how to do it or give a link. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
protasovmikhail, 2019-06-04
@protasovmikhail

su user -c "notify-send 'notification'"
still works, there was a typo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question