views:

763

answers:

2

Is there a library to do pretty on screen display with Python (mainly on Linux but preferably available on other OS too) ? I know there is python-osd but it uses libxosd which looks quite old. I would not call it pretty.

Maybe a Python binding for libaosd. But I did not find any.

+2  A: 

Actually, xosd isn't all that old; I went to university with the original author (Andre Renaud, who is a superlative programmer). It is quite low level, but pretty simple - xosd.c is only 1365 lines long. It wouldn't be hard to tweak it to display pretty much anything you want.

ConcernedOfTunbridgeWells
I will agree with the OP that it isn't very pretty though. The font rendering looks pretty rough.
Jeremy Cantrell
The point is, it's dead simple. You can make it render any bitmap you want with minor modifications.
ConcernedOfTunbridgeWells
Is it OS independent? I'm still trying to figure if it can be installed on windows.
Santi
No, it's closely tied to X as it uses low level X libs. You would need something using Win32 to do this on Windows. IIRC XOSD couldn't be done with GTK which is why it uses Xlib.
ConcernedOfTunbridgeWells
Ah, ok. Looks like it's not my option then. Thanks
Santi
A: 

Using PyGTK on X it's possible to scrape the screen background and composite the image with a standard Pango layout.

I have some code that does this at http://svn.sacredchao.net/svn/quodlibet/trunk/plugins/events/animosd.py. It's a bit ugly and long, but mostly straightforward.

Joe