Skip to content

Instantly share code, notes, and snippets.

@CBJamo
Created March 30, 2019 13:21
Show Gist options
  • Save CBJamo/46161a4531d6ec2f653be0a7a7e9190c to your computer and use it in GitHub Desktop.
Save CBJamo/46161a4531d6ec2f653be0a7a7e9190c to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
import gi
gi.require_version('Gio', '2.0')
from gi.repository import Gio
Application = Gio.Application.new("hello.world", Gio.ApplicationFlags.FLAGS_NONE)
Application.register()
Notification = Gio.Notification.new(sys.argv[1])
Notification.set_body(sys.stdin.read())
Icon = Gio.ThemedIcon.new("dialog-information")
Notification.set_icon(Icon)
Application.send_notification(None, Notification)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment