0

I have a simple Python script here:

#! /usr/bin/python
import os

os.system('notify-send Hello "This is a message"')

When I, as a normal user, run the script in terminal as ./notification.py, a desktop notification is displayed on the screen with the contents Hello This is a message. However, when I (normal user) run sudo ./notification.py, no desktop notification is shown. I am unable to understand this behaviour and how to go about solving it or working around it.

PS:

OS - OpenSUSE Leap 42.1

DE - KDE Plasma v5.5.5

omushpapa
  • 109

1 Answers1

0

It won't show this message. Running with sudo you are running this script as root, and this message should appear on root desktop. Same result you will get when you will be login as root, and try run this script as normal user.

darvark
  • 285