1

In my desktop environment, I am using dunst as notification daemon, and I can send notification as:

notify-send "some message"

I have a terminal window open, where I am logged in as root, and I have backup script running. I would like to receive notification when the script completes.

How can I send notification as root, when I am logged in as regular user?

400 the Cat
  • 819
  • 4
  • 37
  • 85

1 Answers1

-2

Make sure dunst is installed on root if your case is root and run:

 myScript.sh && notify-send "some message"

if you didn't receive a notification then the script didn't return 0 code AKA it failed.

to get notification in case of failure you can run:

myScript.sh && notify-send "some message" || notify-send "script failed!"
Magdy.A
  • 1
  • 1