Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable notification on linux with pynotify/libnotify #23

Open
solsticedhiver opened this issue Mar 11, 2010 · 1 comment
Open

enable notification on linux with pynotify/libnotify #23

solsticedhiver opened this issue Mar 11, 2010 · 1 comment

Comments

@solsticedhiver
Copy link

by loooking carefully at the default settings.py I noticed a setting to enable growl notification.

so i added a few lines here and there to enable notification via pynotify (which uses libnotify)

This is not really an important feature ;-)

one can use PYNOTIFY = True in settings.py and install pynotify
--- a/hydeengine/init.py
+++ b/hydeengine/init.py
@@ -25,6 +25,13 @@ from file_system import File, Folder
from path_util import PathUtil
from processor import Processor
from siteinfo import SiteInfo
+try:
+ import pynotify
+ if not pynotify.init('Hyde'):
+ PYNOTIFY = False
+ PYNOTIFY = True
+except ImportError:
+ PYNOTIFY = False

 class _HydeDefaults:

@@ -248,6 +255,8 @@ class Generator(object):
                 subprocess.call([settings.GROWL, "-n", "Hyde", "-t", title, "-m", message])        
             except:
                 pass    
+        if hasattr(settings, "PYNOTIFY") and settings.PYNOTIFY and PYNOTIFY:
+            pynotify.Notification(title, message, None).show()

     def pre_process(self, node):
         self.processor.pre_process(node)

None is for the icon as there is none for hyde ???

@navilan
Copy link
Member

navilan commented Mar 11, 2010

Nice. Will add in the patch.

Hyde has an icon. I should probably add it to the Hyde repository ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants