3
################################################################################
4
##3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
5
## 10 20 30 40 50 60 70 80
8
## Example of how to use libnotify correctly
11
## chmod +x suppress-sound.py
12
## ./suppress-sound.py
14
## Copyright 2014 Canonical Ltd.
17
## Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
19
## This program is free software: you can redistribute it and/or modify it
20
## under the terms of the GNU General Public License version 3, as published
21
## by the Free Software Foundation.
23
## This program is distributed in the hope that it will be useful, but
24
## WITHOUT ANY WARRANTY; without even the implied warranties of
25
## MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
26
## PURPOSE. See the GNU General Public License for more details.
28
## You should have received a copy of the GNU General Public License along
29
## with this program. If not, see <http://www.gnu.org/licenses/>.
31
################################################################################
38
if __name__ == '__main__':
39
if not pynotify.init ("suppress-sound"):
42
# call this so we can savely use capabilities dictionary later
45
# show what's supported
48
# try suppress-sound support
49
n = pynotify.Notification ("Lotsof N. Oise",
50
"With the popping up of this notification, you should NOT hear a sound being played.",
51
os.getcwd() + "/assets/avatar2.jpg")
52
n.set_hint_string ("sound-file", "/usr/share/sounds/ubuntu/stereo/desktop-login.ogg")
53
n.set_hint_string ("suppress-sound", "true")