Sunday, February 22, 2009

How to install the new Jaunty notify-osd in Ubuntu Intrepid




So the next release of Ubuntu, 9.04 A.K.A. Jaunty has a new Popup notifier. If you want to try it out in Intrepid, follow these simple steps. I have to warn you its a lot of Terminal use, but don't get too intimidated, its really pretty easy. (screenshot from markshuttleworth.com)


A Flash example of the notifier mock-up can be seen here.


Here is an example I recorded of the notify-osd running in Intrepid. My desktop is heavily personalized, but don't let that get in the way of the example. youtube seems to hate my ogv video, theres a bunch of artifacts and the video jumps. in actuality my desktop is smooth as silk. Ive had a lot of requests as to my theme/background/icons etc. Find out more here in a previous post.



First step is to get the code. To do this, you're going to have to install bazaar. Bazaar (AKA bzr) can then fetch the code from launchpad. Bazaar is like git, svn, or cvs. If you want to find out more, visit this 5 minute introduction to bazaar.

$sudo apt-get install bzr


Next we need to actually get the notify-osd code from launchpad:
$bzr branch lp:notify-osd


Dont be alarmed if it reports that you need to log in to launchpad. The code should still be saved in the correct location. Its just reporting that if you used bzr to upload code there would be an error.


Now you should have the code saved on your drive, in your home folder. Specifically ~/notify-osd.
Next step is to compile the code. There is a script included, so its much easier then it sounds.
To compile the code, were going to have to get some dependencies.
$ sudo apt-get install gnome-common automake


Now that we have what we need, we can compile.
$sudo ./autogen.sh


That launches the script, which automatically configures the code for your kernel.
Next step- we make.
$sudo make

Edit: A big thanks to Derek in the comments. He ran $ apt-cache depends notify-osd within Jaunty for me to discover that the following dependencies are required:
libc6 libcairo2 libdbus-1-3 libdbus-glib-1-2 libgconf2-4 libglib2.0-0 libgtk2.0-0 libpango1.0-0 libpixman-1-0 libx11-6
If you get any dependency errors, then run this:
$ sudo apt-get install libc6 libcairo2 libdbus-1-3 libdbus-glib-1-2 libgconf2-4 libglib2.0-0 libgtk2.0-0 libpango1.0-0 libpixman-1-0 libx11-6


If you haven't had any errors yet, everything should be just about done.

To make use of the new notifier, first kill the old notifier (I used System monitor, but the command line can be used as well) Select notification-daemon and right-click, select kill process, or..
$killall notification-daemon

Next, we need to actually launch the new notifier:
Navigate to your ~/notify-osd/src directory.
$notify-osd

Thats it! Were done!

If you want to test out the new notifier, you can launch the send-test-notification.sh script by clicking it and clicking run, or by navigating to the ~/notify-osd/src directory and typing:
$ ./send-test-notification.sh

The example script above may look weird because there are a few errors in the script code. The call to the icon files is not properly linked. I dont know if thats just because someone changed something on launchpad and forgot to update it or what. Dont be alarmed though if it looks funky. Everything is working properly, its just the script thats messed up.

Don't worry about messing up your Intrepid install. We haven't made any permanent changes to your system, and when you restart your computer the old notifier will be back.
If you want to keep the changes every time you restart, you can just remove the old notification-daemon on startup, and replace it with the new notify-osd.

Script to make notify-osd run on restart:
$ gedit ~/.config/autostart/notify-osd.sh


...paste this in the file:

#!/bin/bash
killall notification-daemon
sleep 1
~/notify-osd/src/notify-osd


...then in terminal:
$ chmod +x ~/.config/autostart/notify-osd.sh


...then:
$ gedit ~/.config/autostart/notify-osd.desktop


...and paste this in the file: user name is the name of the session
[Desktop Entry]
Type=Application
Name=notify-osd
Exec=/home/user name/.config/autostart/notify-osd.sh
Icon=system-run
Comment=
X-GNOME-Autostart-enabled=true


Now, every time you restart xorg, (aka reboot, start new session, etc) you will have the new notify-osd run.


A few notes: You will need a proper Display Driver running, and Compiz enabled to make proper use of the new features such as transparencies. If you see something that Ive done wrong or that could be done better, don't hesitate to tell me in the comments. Also, when you end the old notifications-daemon it may break other daemons which are using it (i.e. cGmail). Simply restart the the cGmail daemon and it should work fine.

34 comments:

Anonymous said...

The unmet dependencies are libgtk2.0-dev, libgconf2-dev and libdbus-glib something ;). I got some errors during the compilation thou and I can't get past that unfortunately.

Nicolaide said...

I cant download from launchap... The error is that

nicolas@nicolas-laptop:~$ bzr branch lp:notify-osd
You have not informed bzr of your launchpad login. If you are attempting a
write operation and it fails, run "bzr launchpad-login YOUR_ID" and try again.
bzr: ERROR: Invalid http response for http://bazaar.launchpad.net/%7Enotify-osd-developers/notify-osd/main/.bzr/repository/packs/f8097ae6b0b6a1353502801617edd7cf.pack: Expected a boundary (Ls(UOsPUAG1Dk8lJdM5Z) line, got ''


Ideas? Thanks!

Anonymous said...

~/notify-osd/src$ notify-osd
$command not found

any ideas?

also, 'sudo autogen.sh' didn't work but 'sudo sh autogen.sh' did. and i had to include sudo when running 'make'.

Anonymous said...

package libdbus-glib-dev has no installation candidate

libdbus-glib0-dev should be libdbus-glib-1-dev

Vasanth said...
This post has been removed by the author.
David said...

All works well, but I don't seem to get getting the icons in the notification popups. What package should I install? They are not in human-icon-theme. Thanks, this is cool.

kais.bejaoui said...

Hi, when I try to test the new notification, I get this error

./send-test-notification.sh: 3: notify-send: not found

make went smoothly and notify-osd is running

any ideas?

alex said...

@David,
Im guessing you mean the icons in the example script? as i explained, the script has a few errors on it. The file name of the icons are wrong. If it really bugs you, you can open the script file with a text editor and change the path and filename to be accurate.
if you just want to create a fake notification, you can type this into terminal:
notify-send "this is a test" "hello world" -i /usr/share/icons/application-default-icon.png

kais.bejaoui said...

Actually notify-send is found in the package libnotify-bin, I installed it and now it works !

Vasanth said...
This post has been removed by the author.
Anonymous said...

got it running on intrepid without much problem. sh autogen.sh, configure, make, jobs a good'un

UNT XA said...

It worked until I typed "notify-osd" and gave me this error:
bash: notify-osd: command not found

Any ideas?

alex said...

UNT XA you are in the wrong path
try
cd ~/notify-osd/src/
notify-osd

Derek said...

$ apt-cache depends notify-osd
notify-osd
Depends: libc6
Depends: libcairo2
Depends: libdbus-1-3
Depends: libdbus-glib-1-2
Depends: libgconf2-4
Depends: libglib2.0-0
Depends: libgtk2.0-0
Depends: libpango1.0-0
Depends: libpixman-1-0
Depends: libx11-6
Depends: human-icon-theme
Conflicts: alsdorf
Conflicts: notify-daemon
Replaces: alsdorf
Replaces: notify-daemon

KaruppuSwamy T said...

>~/notify-osd/src$ notify-osd
>$command not found

>any ideas?

~/notify-osd/src$ ./notify-osd

should work.

alex said...

Red Nikon -
make sure youre in the correct directory.
$cd ~/notify-osd
then try
$sudo sh ./automake.sh

Jarno said...


Red Nikon -
make sure youre in the correct directory.
$cd ~/notify-osd
then try
$sudo sh ./automake.sh

I'm ending at this point too. My output:

~/notify-osd$ sudo sh ./automake.sh
sh: Can't open ./automake.sh
~/notify-osd$ sudo ./automake.sh
sudo: ./automake.sh: command not found
~/notify-osd$ sudo ./automake
sudo: ./automake: command not found
~/notify-osd$ sudo automake
configure.in:4: required file `config.h.in' not found

Any suggestions?

kais.bejaoui said...

Jarno

automake.h simply doesn't exist in the directory. Try autogen.h instead. that worked in my case

ViPER said...

desktop:~/notify-osd$ sudo ./automake.sh
sudo: ./automake.sh: command not found

i get that error when i try to do it

Jarno said...

I get the same error as Jonathan. Not completely successful yet.

Jarno said...

No garanties, but the following packages helped me get the ./autogen.sh to succeed:

sudo apt-get install libgtk2.0-dev libgconf2-dev libdbus-glib-1-dev libgift-dev

Anonymous said...

Installed and ran well in fedora test worked however loads of erros maybe they are not present in ubuntu any ideas, wow while writing this rythmbox just poped up in the notifier looks nice!

(notify-osd:20573): GLib-GObject-WARNING **: value "0" of type `gint' is invalid or out of range for property `pixels-per-em' of type `gint'

** (notify-osd:20573): CRITICAL **: load_icon: assertion `info' failed

** (notify-osd:20573): CRITICAL **: load_icon: assertion `info' failed

** (notify-osd:20573): WARNING **: bubble_recalc_size(): WARNING, no layout!!!


** (notify-osd:20573): CRITICAL **: load_icon: assertion `info' failed

** (notify-osd:20573): WARNING **: WARNING: No layout defined!!!


** (notify-osd:20573): CRITICAL **: load_icon: assertion `info' failed

** (notify-osd:20573): CRITICAL **: load_icon: assertion `info' failed

** (notify-osd:20573): WARNING **: bubble_recalc_size(): WARNING, no layout!!!


** (notify-osd:20573): WARNING **: WARNING: No layout defined!!!


** (notify-osd:20573): WARNING **: WARNING: No layout defined!!!


** (notify-osd:20573): CRITICAL **: load_icon: assertion `info' failed

** (notify-osd:20573): WARNING **: bubble_recalc_size(): WARNING, no layout!!!

ubukool said...

This should work for everyone:

$ sudo apt-get install bzr gnome-common automake libdbus-glib-1-dev libgtk2.0-0 libgtk2.0-dev libgtk2.0-common libgconf2-dev libx11-dev libnotify-dev libnotify1 libnotify-bin

$ cd /home/[username]/notify-osd
$ ./autogen.sh
$ make
$ killall notification-daemon ; /home/[username]/notify-osd/src/notify-osd

you can go back to the old notifications with 'ctrl-c' in terminal

courtesy of 'keith' on this page:

http://www.stefanoforenza.com/how-to-get-the-new-notifications-on-intrepid/

I hope it works for you

Onoametal said...

Is it normal to have these error with make command?

make[2]: *** [test_modules-test-withlib.o] Error 1
make[2]: se sale del directorio `/home/julian/notify-osd/tests'
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio `/home/julian/notify-osd'
make: *** [all] Error 2

I did some testing and it works... :S Any ideas?

Onoametal said...

Actually it doesn't work... I appreciate your help!

Anonymous said...

It works after trying and trying: Delete the notify-osd folder, the redo all the steps again (this applies to those like who had to apt-get all libraries that were not properly installed before running bzr... autogen.sh...make and... finally it worked!!! (BTW it only worked with ./notify.osd while in the $user/notify-osd/src directory.
Good luck

wardy277 said...

when i unplug my power cable from my laptop i dont get the new notifications. instead i get a window titled power manager with the contents of what was in the notification in this window. its like the power manager tried to use the old one and couldn't find it do used a default window instead, any ideas?

Kareeser said...

Hm. Apparently, the listed dependencies were not enough. To get autogen.sh to configure properly, I had to run

sudo apt-get install libwnck*

Shotgun approach, but it worked :)

aminamin said...

This site is very cool I liked all the topics.
I ask you to convey some of its articles to this site

http://www.malak-rouhi.com/vb/

Brian said...

so i noticed in your video the notifications work for volume and brightness, but when i installed this, it uses the regular intrepid notifications for volume and brightness...

Anonymous said...

I keep getting this error at the autogen.sh step:

checking for LIBNOTIFY... configure: error: Package requirements (libnotify >= 0.4.5) were not met:

Requested 'libnotify >= 0.4.5' but version of libnotify is 0.4.4

Any suggestions?

David Tam said...

for a libnotify 0.4.5 build for intrepid..

https://launchpad.net/~futurepilot/+archive/ppa/+build/793310

retro said...

Why sudo ./autogen.sh and sudo make ?

Root account is needed only by install make. Other stuff like ./configure, make and etc. does't need root access.

Anonymous said...

doesn't it work any more?
i get :
sudo: ./autogen.sh: command not found

help! ;)