Answer the question
In order to leave comments, you need to log in
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
su user -c "notify-send 'notification'"
still works, there was a typo
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question