Sunday, April 19, 2009

Installing Screenlets with composite effects without Compiz

(on an eeePC with EEEbuntu)


Screenlets also run without Compiz, but if you need composite effects you may opt for a lite composite manager like "Xcompmgr" (ArchWiki). Install with:
sudo apt-get install xcompmgr

run with:
xcompmgr -withsomeoptions
or put in your startup list, (with gnome, go to System > Control center > Sessions > Add):
/usr/bin/xcompmgr -withsomeoptions &
Install "Screenlets":
sudo apt-get install screenlets
Select and place your screenlets, but you will notice soon that when you hit "Show desktop" or "Minimize all windows", all screenlets also become minimized and disappear. To keep them on the desktop (following this post), you have to edit /usr/lib/python2.5/site-packages/screenlets/__init__.py at the section below:
        # set type hint

if str(sensors.sys_get_window_manager()).lower() == 'kwin':
print "WARNING - You are using kwin window manager , screenlets doesnt have full compatibility with this window manager"
#self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
elif str(sensors.sys_get_window_manager()).lower() == 'sawfish':
print "WARNING - You are using kwin window manager , screenlets doesnt have full compatibility with this window manager"
else:
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_TOOLBAR)
self.window.set_keep_above(True)
self.window.set_skip_taskbar_hint(True)
self.window.set_skip_pager_hint(True)
and modify the line in bold, so that it becomes:
        # set type hint

if str(sensors.sys_get_window_manager()).lower() == 'kwin':
print "WARNING - You are using kwin window manager , screenlets doesnt have full compatibility with this window manager"
#self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
elif str(sensors.sys_get_window_manager()).lower() == 'sawfish':
print "WARNING - You are using kwin window manager , screenlets doesnt have full compatibility with this window manager"
else:
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DOCK)
self.window.set_keep_above(True)
self.window.set_skip_taskbar_hint(True)
self.window.set_skip_pager_hint(True)

and then restart the screenlets. The side effect of this workaround is that the screenlets can not be moved anymore. If you need to move them, you have to revert the changes in the file above, move them to a new place on the desktop, and then re-apply the changes.
Tricky but it works.