{{Article summary text|This article discusses how to install, configure and use libnotify for application development.}}

{{Article summary text|This article discusses how to install, configure and use libnotify for application development.}}

Line 9:

Line 9:

{{Article summary end}}

{{Article summary end}}

−

'''Libnotify''' is an easy way to display desktop notifications and information in a small dialog. It implements the [http://www.galago-project.org/specs/notification/ Desktop Notifications Specification] and it is already used by many open source apps like [[Evolution]], [[Pidgin]], etc. It has support for [[GTK+]] and [[Qt]] applications and is desktop independent.

+

'''Libnotify''' is an easy way to display desktop notifications and information in a small dialog. It implements the [http://developer.gnome.org/notification-spec/ Desktop Notifications Specification] and it is already used by many open source apps like [[Evolution]], [[Pidgin]], etc. It has support for [[GTK+]] and [[Qt]] applications and is desktop independent.

==Installation==

==Installation==

Line 18:

Line 18:

===Builtin servers===

===Builtin servers===

−

[[GNOME]] and [[KDE]] use their own implementations to display notifications, and you can't replace them. Their notification servers are started automatically on login to receive notifications from applications via DBus.

+

[[Cinnamon]], [[GNOME]] Shell and [[KDE]] use their own implementations to display notifications, and you can't replace them. Their notification servers are started automatically on login to receive notifications from applications via DBus.

+

* {{Pkg|cinnamon}} provides a notification server itself. Notifications are displayed at the top right corner of the screen.

* {{Pkg|gnome-shell}} provides a notification server itself. Notifications are displayed at the bottom of the screen.

* {{Pkg|gnome-shell}} provides a notification server itself. Notifications are displayed at the bottom of the screen.

* KDE uses '''knotify4''' from package {{Pkg|kdebase-runtime}} to display notifications. Notifications are displayed at the bottom right corner of the screen.

* KDE uses '''knotify4''' from package {{Pkg|kdebase-runtime}} to display notifications. Notifications are displayed at the bottom right corner of the screen.

Line 25:

Line 26:

In other desktop environments, the notification server is launched on the first call via DBus. You can choose one of the following implementations:

In other desktop environments, the notification server is launched on the first call via DBus. You can choose one of the following implementations:

* {{pkg|notification-daemon}} is the notification server used by GNOME in Fallback Mode. Notifications are displayed at the top right corner of the screen.

* {{pkg|notification-daemon}} is the notification server used by GNOME in Fallback Mode. Notifications are displayed at the top right corner of the screen.

−

:{{Note|notification-daemon doesn't have a DBus service file, so you have to [[autostart]] it. (Already done in GNOME Fallback Mode.)}}

+

:{{Note|notification-daemon doesn't have a DBus service file, so you have to [[autostart]] it. (Already done in GNOME Fallback Mode.) To start the daemon manually, execute the following command: {{ic|/usr/lib/notification-daemon-1.0/notification-daemon}}.}}

* {{Pkg|xfce4-notifyd}} is a notification server for [[Xfce]], available in the official repositories.

* {{Pkg|xfce4-notifyd}} is a notification server for [[Xfce]], available in the official repositories.

:{{Tip|To configure xfce4-notifyd, run the following command in the terminal: {{ic|xfce4-notifyd-config}}.}}

:{{Tip|To configure xfce4-notifyd, run the following command in the terminal: {{ic|xfce4-notifyd-config}}.}}

−

* {{AUR|notify-osd}} is a notification server for [[Unity]], available in the AUR.

+

* {{pkg|dunst}} is a minimalistic notification daemon for Linux designed to fit nicely into minimalistic windowmanagers like [[dwm]].

−

* {{AUR|awn-extras-applets}} contains a notification-daemon applet for the [[Avant Window Navigator]], available in the [[Arch User Repository]].

+

* {{Pkg|notify-osd}} is a notification server for [[Unity]], available in the official repositories.

+

* {{Pkg|awn-extras-applets}} contains a notification-daemon applet for the [[Avant Window Navigator]], available in the official repositories.

+

* {{AUR|statnot}} is a small, lightweight notification daemon that can output notifications to the root window's title, stdout or FIFO pipes, making it integrate very well with tiling window managers. It's available in the [[Arch User Repository]] or as a [https://github.com/halhen/statnot git repo].

+

* {{AUR|twmn}} is a notification system for tiling window managers. It's available in the [[Arch User Repository]] or as a [https://github.com/sboli/twmn git repo].

==Tips and tricks==

==Tips and tricks==

Line 164:

Line 168:

Or you can use the old, static python-notify bindings:

Or you can use the old, static python-notify bindings:

−

*Dependency: {{Pkg|python-notify}}

+

*Dependency: {{Pkg|python2-notify}}

{{hc|hello_world.py|<nowiki>#!/usr/bin/python2

{{hc|hello_world.py|<nowiki>#!/usr/bin/python2

import pynotify

import pynotify

Revision as of 11:19, 11 February 2013

Libnotify is an easy way to display desktop notifications and information in a small dialog. It implements the Desktop Notifications Specification and it is already used by many open source apps like Evolution, Pidgin, etc. It has support for GTK+ and Qt applications and is desktop independent.

Installation

Builtin servers

Cinnamon, GNOME Shell and KDE use their own implementations to display notifications, and you can't replace them. Their notification servers are started automatically on login to receive notifications from applications via DBus.

cinnamon provides a notification server itself. Notifications are displayed at the top right corner of the screen.

gnome-shell provides a notification server itself. Notifications are displayed at the bottom of the screen.

KDE uses knotify4 from package kdebase-runtime to display notifications. Notifications are displayed at the bottom right corner of the screen.

Other servers

In other desktop environments, the notification server is launched on the first call via DBus. You can choose one of the following implementations:

notification-daemon is the notification server used by GNOME in Fallback Mode. Notifications are displayed at the top right corner of the screen.

Note: notification-daemon doesn't have a DBus service file, so you have to autostart it. (Already done in GNOME Fallback Mode.) To start the daemon manually, execute the following command: /usr/lib/notification-daemon-1.0/notification-daemon.

xfce4-notifyd is a notification server for Xfce, available in the official repositories.

Tip: To configure xfce4-notifyd, run the following command in the terminal: xfce4-notifyd-config.

dunst is a minimalistic notification daemon for Linux designed to fit nicely into minimalistic windowmanagers like dwm.

notify-osd is a notification server for Unity, available in the official repositories.

statnotAUR is a small, lightweight notification daemon that can output notifications to the root window's title, stdout or FIFO pipes, making it integrate very well with tiling window managers. It's available in the Arch User Repository or as a git repo.