Ubuntu by default have the python-notify installed. If don't install it using
1 | sudo apt-get install python-notify |
Sample notification program using python for notifyOSD
Now you open gedit or any other text editor, paste the following code and save it as notify.py
#!/usr/bin/pythonimport sysimport pynotifyif __name__ == "__main__": if not pynotify.init("icon-summary-body"): sys.exit(1) n = pynotify.Notification( "Burhan Uddin", "What is life? Full of of care? We have no time to stand or stare!", "notification-message-im") n.show() |
Now run this py file using terminal
1 | python notify.py |
And see the output ..
No comments:
Post a Comment
Thanks for Visiting LinuxWorkstation