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.
19
from __future__ import absolute_import
20
from __future__ import division
21
from __future__ import print_function
23
from textwrap import dedent
28
pynotify.init("Guake")
30
__all__ = ['show_message']
32
RETRY_INTERVAL = 3 # seconds
34
retry_limit = 5 # tries
37
def show_message(brief, body=None, icon=None):
39
notification = pynotify.Notification(brief, body, icon)
43
glib.timeout_add_seconds(RETRY_INTERVAL, lambda: retry(brief, body, icon))
57
if not hasattr(print_warning, 'already_printed'):
59
Notification service is not running (yet). Guake can't display notifications!
60
We'll retry a few times more a bit later, but you can use
61
the following command to disable the startup notification:
62
$ gconftool-2 --type bool --set /apps/guake/general/use_popup false
64
print_warning.already_printed = True