2
Copyright (C) 2013 Maxim Ivanov <ulidtko@gmail.com>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License as
6
published by the Free Software Foundation; either version 2 of the
7
License, or (at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
General Public License for more details.
14
You should have received a copy of the GNU General Public
15
License along with this program; if not, write to the
16
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
23
pynotify.init("Guake")
25
__all__ = ['show_message']
27
RETRY_INTERVAL = 3 # seconds
29
retry_limit = 5 # tries
32
def show_message(brief, body=None, icon=None):
34
notification = pynotify.Notification(brief, body, icon)
38
glib.timeout_add_seconds(RETRY_INTERVAL, lambda: retry(brief, body, icon))
52
if not hasattr(print_warning, 'already_printed'):
54
Notification service is not running (yet). Guake can't display notifications!
55
We'll retry a few times more a bit later, but you can use
56
the following command to disable the startup notification:
57
$ gconftool-2 --type bool --set /apps/guake/general/use_popup false
59
print_warning.already_printed = True