View Full Version : HOWTO: Screenlets without Compiz

March 28th, 2010, 02:37 AM
This is a tutorial intended for users that are unable to run Compiz, or have no hardware acceleration(like me :D).

Get WMctrl
So, first thing you need is WMctrl (http://tripie.sweb.cz/utils/wmctrl/), which is a powerful command line tool, capable of moving windows around to different workspace, resizing, and all that stuff.

sudo apt-get install wmctrl

Create the perl script

vim ~/Screenlethide.pl
Make sure you are in Insert mode and paste the following:

@window_list = `wmctrl -l | grep "Screenlet.py"`;
foreach my $win (@window_list){
$id=substr $win,0,10;;
$desktop = substr($win,10,3);
system("wmctrl -i -r $id -t $moveto");

save and chmod the file to execute:

chmod +x Screenlethide.pl
What that script does is take any window whose title ends in "Screenlet.py" and moves it to workspace 1. If its already in that workspace it moves it to workspace 0.
Add the Shortcut
Now add the shortcut to Gnome(I don't know how to do this in KDE :()

Click 'Add, Name it "Screenlet hide", and put the command as "~/Screenlethide.pl"
Click Apply.
Add a shortcut.

Let me know if I did anything wrong!:P