1 ## Copyright (C) 2006 Søren Hauberg
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 2 of the License, or
6 ## (at your option) any later version.
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
13 ## You should have received a copy of the GNU General Public License
14 ## along with this program; If not, see <http://www.gnu.org/licenses/>.
17 ## @deftypefn {Function File} zenity_notification(@var{text}, @var{icon})
18 ## Displays an icon with a text in the notification area.
19 ## The variable @var{text} sets the text in the notification area, and the
20 ## optional variable @var{icon} determines which icon to show.
21 ## @var{icon} can be either @code{info}, @code{warning}, @code{question},
24 ## @seealso{zenity_calendar, zenity_list, zenity_progress, zenity_entry, zenity_message,
25 ## zenity_text_info, zenity_file_selection}
28 function zenity_notification(text, icon)
29 if (nargin == 0 || !ischar(text))
34 if (nargin > 1 && ischar(icon))
35 icon = sprintf('--window-icon="%s"', icon);
38 cmd = sprintf('zenity --notification --text="%s" %s', text, icon);
39 [status, output] = system(cmd);
41 error("zenity_notification: %s", output);