Questions tagged [pynotify]

39 questions
7
votes
1 answer

How to remove an obsolete pynotify notification?

I just started with python and wrote myself a nice, small script that uses gnome-notifications via pynotify, like this: import pynotify pynotify.init("Application") alert = pynotify.Notification("Title", "Description") alert.show(); This works…
user658042
7
votes
8 answers

ImportError: No module named pynotify. While the module is installed

So this error keeps coming back. Everytime I try to tun the script it returns saying: Traceback (most recent call last): File "cli.py", line 11, in import pynotify ImportError: No module named pynotify The strange thing is, I just…
Olav Alberts
  • 71
  • 1
  • 1
  • 3
6
votes
1 answer

Pynotify screws up datetime, why?

The Problem This code #!/usr/bin/env python import pynotify import time import datetime c='5/1/12 1:15 PM' print c dt = time.strptime(c, "%d/%m/%y %H:%M %p") produces 5/1/12 1:15 PM Traceback (most recent call last): File "tmp.py", line 9, in…
EricR
  • 1,487
  • 2
  • 21
  • 42
5
votes
1 answer

What are the differences between Notify and pynotify?

I'm trying to understand the differences between Notify (python wrapper) and pynotify. For example : from gi.repository import Notify and import pynotify The code to create a notification looks similar but it seems that I can't import pynotify…
Depado
  • 4,811
  • 3
  • 41
  • 63
4
votes
1 answer

Callbacks and gtk main loop

I'm trying to make a simple Unix desktop application which uses the pynotify notification system to show users some alerts and allow them to launch relevant applications from a button on placed on the alert. Here is the relevant simplified code…
gentledevil
  • 143
  • 5
4
votes
3 answers

How to center a GNOME pop-up notification?

To display a GNOME pop-up notification at (200,400) on the screen (using Python): import pynotify n = pynotify.Notification("This is my title", "This is my description") n.set_hint('x', 200) n.set_hint('y', 400) n.show() I'm a gtk noob. How can I…
Michael Gundlach
  • 106,555
  • 11
  • 37
  • 41
4
votes
1 answer

PyNotify not working from cron?

I've written a script that uses pynotify to give an alert. it works just fine when I run it (python script.py), but when run from cron with 00 * * * * myname python ~/scripts/script.py, it doesn't work! I haven't a clue why. Here's the snippet: …
Nona Urbiz
  • 4,873
  • 16
  • 57
  • 84
3
votes
1 answer

How to customize pynotify?

How to set icon size in the notifications? How to set how much time the notification have to be shown? Where is a complete pynotify documentation? Can the notification be clickable? (example: if I click on the notification, print "hello world" in…
xRobot
  • 25,579
  • 69
  • 184
  • 304
3
votes
2 answers

Python code working in a terminal but not in a cronjob

I've written a code that'll notify me whenever it is executed. I want to run this code after every half an hour, hence created a cronjob. But the code does not work when executed through cronjob. Here's my code: import sys import pynotify if…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
3
votes
1 answer

Read new line with pynotify

I'm trying to display a new line that was added to the file. So imagine that I have a sample_file.txt : 1. line 1 2. line 2 3. line 3 I want to check if this file got a new line, and than display that line (without printing all the file…
Vor
  • 33,215
  • 43
  • 135
  • 193
2
votes
2 answers

Windows notifications in python

I'm trying to make a toast notification on win 10 with python. However, every time I try, I got an error that involves something called "shell notify icon". And when I mean every time... I tried with every library I could find ! Notifypy,…
Quantum Sushi
  • 504
  • 7
  • 23
2
votes
1 answer

How to merge notifications with a common title in pynotify?

How can I tell a pynotify.Notification object to merge with another that has the same title?
david4dev
  • 4,854
  • 2
  • 28
  • 35
2
votes
1 answer

ImportError: No module named pynotify, despite having the module installed

>>> import pynotify Traceback (most recent call last): File "", line 1, in ImportError: No module named pynotify >>> I have installed py-notify module. This is the error I'm getting when I import it and I'm losing my mind thinking…
sagar_jeevan
  • 761
  • 5
  • 16
  • 34
2
votes
0 answers

Startup Application Python Program in Ubuntu stops running after a period of time

Here's the code. It runs for usually somewhere less than an hour and stops giving out the notifications or writing anything to the log file. The code is run as a Startup application on Ubuntu 16.04. I have tried adding exceptions for all kinds of…
Athul
  • 21
  • 1
2
votes
1 answer

How to get pynotify to display line breaks and HTML?

How can I make pynotify display line breaks and HTML in the notifications? Here is what I got: >>> import pynotify >>> n = pynotify.Notification ("This is a test.\n\nAnd this too!", "","notification-message-im") >>>…
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361
1
2 3