Difference between revisions of "Desktop notifications"

From ArchWiki
Jump to: navigation, search
(+ i18template)
Line 8: Line 8:
 
==Introduction==
 
==Introduction==
  
Libnotify is an easy way to display desktop notifications and information in a small dialog. It's used in much opensource 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's used in much opensource apps like Evolution, Pidgin, etc. It has support for Gtk+ and Qt applications and is desktop independent.
 
+
  
 
==Installation and Configuration==
 
==Installation and Configuration==
Line 20: Line 19:
 
  pacman -S notification-daemon
 
  pacman -S notification-daemon
  
For Configuring
+
For configuring
 
   
 
   
 
  pacman -S gconf-editor
 
  pacman -S gconf-editor
Line 36: Line 35:
 
==Tips & Tricks==
 
==Tips & Tricks==
  
You can write your own libnotify display messages easily in python or other langauges. Here is an simple python example.
+
You can write your own libnotify display messages easily in Python or other languages. Here is a simple Python example.
  
Note you will need to install the python bindings for libnotify
+
Note you will need to install the Python bindings for libnotify
  
 
  pacman -S python-notify  (communitiy)
 
  pacman -S python-notify  (communitiy)

Revision as of 22:43, 22 November 2010


This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Desktop notifications#)

Introduction

Libnotify is an easy way to display desktop notifications and information in a small dialog. It's used in much opensource apps like Evolution, Pidgin, etc. It has support for Gtk+ and Qt applications and is desktop independent.

Installation and Configuration

pacman -S libnotify

Now to configure libnotify and use libnotify you can use the gnome or xfce4

Gnome

pacman -S notification-daemon

For configuring

pacman -S gconf-editor

then run gconf-editor and select "/apps/notification-daemon/" . There you can configure the notify widget

XFCE

pacman -S xfce4-notifyd
pacman -S xfconf 

For configuration run

xfce4-notifyd-config

Tips & Tricks

You can write your own libnotify display messages easily in Python or other languages. Here is a simple Python example.

Note you will need to install the Python bindings for libnotify

pacman -S python-notify  (communitiy)

Hello world example

#!/usr/bin/env python
import subprocess
info = "Hello world "
subprocess.call(('notify-send',info))
#!/usr/bin/python
import subprocess
import commands    
#KERNEL VERSION
uname = commands.getoutput('uname -r')
head = "All the info about your system:"
msg = "Your kernel version: "+ uname +"\n"       
# print message
subprocess.call(['notify-send', head, msg])

Or you can just use bash

# send a notification saying hello world
notify-send "hello world"

More Resources

Libnotify python example another libnotify example