Tuesday·26·October·2010
ratpoison and focus follows mouse //at 00:22 //by abe
I use ratpoison as window manager on my ASUS EeePC netbook “nemo” for more than two years now. But although I’m very happy with ratpoison in the EeePC, there are two feature wishes which have been refused by upstream: One is more flexibel window name matching for the unmanage command. The other one is “focus follows mouse” between ratpoison frames.
Well, I always guessed that it was possible, but it took until now to find outhow to implement “focus follows mouse” for ratpoison.
There’s an ancient but still useful tool called Not a Window Manager (nawm) which is a small awk-like interpreter offering mostly window handling functions.
The following .nawmrc implements “focus follows mouse” in nawm:
window newwin; # stores window to raise window lastwin; # stores previous window to prevent race conditions leave { lastwin = currentwindow; } enter { newwin = pointerwindow(); if (name(newwin) != "" && newwin != lastwin) { raise newwin; sync; } }
The leave hook is necessary to prevent flapping between two windows if switched between them via ratpoison’s commands.
I also had to add the following hook to my .ratpoisonrc to work around some cases where ratpoison’s own window switching didn’t work anymore. Only happened with more than one frame — with one frame banishing the mouse cursor was annoying, so I filtered that case:
addhook switchwin exec if [ `ratpoison -c fdump|fgrep -o frame|wc -l` -gt 1 ]; then ratpoison -c banish; fi
Unfortunately nawm has been removed from Debian Sid about a year ago due to being buggy and orphaned. There was not upstream development for seven years or so either.
So for the moment you can get nawm either from Debian Lenny or from snapshot.debian.org.
But I had to fix a segfault in nawm when calling name() on a window without name to be able to use it at all, so you will probably have to rebuild it anyway with the following patch:
diff -u nawm-0.0.20030130/builtins.c nawm-0.0.20030130-patched/builtins.c --- nawm-0.0.20030130/builtins.c 2010-10-25 06:00:02.000000000 +0200 +++ nawm-0.0.20030130-patched/builtins.c 2010-10-25 04:15:25.000000000 +0200 @@ -546,8 +546,12 @@ *name = gcstrdup(""); else { - *name = gcstrdup((char *)nm); - XFree(nm); + if ((char *)nm) { + *name = gcstrdup((char *)nm); + XFree(nm); + } else { + *name = gcstrdup(""); + } } }
And yes, I’m thinking about adopting and reintroducing the nawm package into Debian Sid.
But I’d prefer if anyone could give me a hint how to do this with more
current and still maintained tools (or a patch against ratpoison :-).
I looked into suckless-tools, but I haven’t found anything in
there which provides hooks on X events. And the Perl module Tk seems
to be able to set X event hooks, but only within the application being
written itself.
Tagged as: ASUS, awk, Debian, dwm, EeePC, FocusFollowsMouse, Hack, Hacks, hook, Lenny, nawm, nemo, ratpoison, segfault, Sid, Squeeze, suckless, Window Manager, X
// show without comments // write a comment
Related stories
Sunday·25·May·2008
Google Open Source Jam and Webtuesday Hackday //at 22:45 //by abe
I was at two geek events in Zurich this week: At the Google Open Source Jam Zurich on Thursday evening and at the first Webtuesday Hackday on Saturday.
Somehow I expected both events to be quite similar, but they weren’t.
Google Open Source Jam
When I read “Jam” or “Jam Session” I think of Jazz musicians spontaneously playing together. So for me “Open Source Jam” sounded like a hack session where some spontaneous coding is done. But there was no spontaneous collaboration at Open Source Jam at all. It’s just (more or less spontaneous) talks about different topics and chatting. So I was quite disappointed from that event.
There were though quite a lot of people I knew from e.g. Webtuesday, Chaostreff or Debian. I even met some people I just knew from IRC until then.
Half of the talks were sole propaganda talks though, e.g. for Webtuesday Hackday, OpenExpo and Soaring as a geek sport. Not really wrongly placed talks, but not what I expected in talks at Open Source Jam.
The few rooms and floors I saw reminded me very much to IKEA Children’s Paradies, just even more motley. Though it felt all sterile and wasn’t by far as cool as I expected after what I read elsewhere of Google offices.
I also think that several of the Google employees showed some contrived friendlyness, and questions I asked e.g. why I have to give them my e-mail address and employer’s name (what do unemployed or self-employed people do?) got answered with answers I do not really believe – like “for security”. A leopard doesn’t change its spots. A data squid probably neither, even not at events labeled with OSS and said to be for the community.
I suspect that finding new employees is one of the reasons behind such events at Google. But after my first visit at one of their locations, this company still makes me feel uncomfortable. And I’m even more sure than before that I wouldn’t want to work there.
Not sure if I’ll attend the Google Open Source Jam a second time.
Webtuesday Hackday
Webtuesday Hackday also was not as I expected, but still more close to my expectations: the Webtuesday crowd gathers for hacking instead of having long talks. :-)
There were surprisingly many people from outside Zurich, from Munich and Belgium, from Lake Constance and Lausaunne – not only the usual suspects (who were there anyway ;-).
The event took place at Liip’s new office. They still look a little bit empty and steril, but all the toys (mini rugby balls, Wii, plush figures on floor lamps) and people around made them very alive. And they had very cool lamps in the form of their company logo in the office. They sure have a good interior designer. :-)
Although most participants found time to do some hacking, many found less time than they expected so we hope that we can glue the talks a little bit more together in regards of timing to cause less interruptions of the hacking.
The food was also better at Hackday, too, but mostly because we ate outside. ;-) For lunch we were at Lily’s Stomach Supply at Langstrasse (very recommendable!) and in 6he evening we were at Pizzeria Grottino 79 near Helvetiaplatz. Had a Pizza Vesuvio with Gruyère cheese there.
Hackday also had a surprise for me: The IRC channel at Hackday was but when I entered the channel there were someone in I didn’t expect there: tklauser aka Tobias Klauser aka tuxedo. Even more surprising, he read about my project idea for Hackday – a semantic feed cache proxy – and liked it, so he decided to come over to Zurich and join the project.
We didn’t came that far until Tobias had to leave again, but the progamming language and partially also libraries had been nailed: Ruby and it’s WEBrick framework. After the Hackday I worked on it a few more hours and it now already saves feeds to a cache. The Mercurial repository is at http://noone.org/hg/sfc-proxy.
There were several reasons which spoke for using Ruby instead of Perl (my favourite progamming language and the one I’m most experienced in): Ruby brings HTTP and RSS support already in it’s standard classes and Tobias is more experienced in Ruby than Perl. I started to learn Ruby a few years ago to look beyond my own nose and to get my hands dirty on some object-oriented and nice programming language, but I hadn’t found an appropriate project until now, so this was one more reason to not do it in Perl.
I also worked on my Debian package of Conkeror during Hackday. It’s already usable and I now use Conkeror as primary web browser on my EeePC, but e.g. the man page is still missing. As soon as I have the minimum in necessary documentation ready I’ll let it upload to Debian Experimental (since its dependency XULRunner 1.9 is also only in Debian Experimental yet). The Mercurial repository for the Debian packaging of Conkeror is at http://noone.org/hg/conkeror/debian
Those who were still at Hackday in the evening decided that the
Webtuesday Hackday should become a regular institution and should take
place approximately every two months, but stay a one day event (for
now). I already look forward to the next Webtuesday Hackday.
Tagged as: Atom, Conkeror, data squid, Debian Experimental, Die Welt ist klein, Events, Freenode, Google, Hackday, Hacks, hg, HTTP, IRC, liip, Mercurial, NDA, Open Source, Open Source Jam, Other Blogs, Perl, Planet Webtuesday, proxy, RDF, RSS, Ruby, SFC, tuxedo, WEBrick, Webtuesday, XULRunner, Zürich
// show without comments // write a comment
Related stories
Wednesday·10·October·2007
Plugins in the Blosxom Project CVS //at 00:34 //by abe
Since yesterday, my Blosxom plugins are versioned in the Blosxom Project CVS repository together with those of most other Blosxom developers.
Cause for this is, that — besides first steps towards Blosxom v4 (we better forget about v3… ;-) and intergrating existing patches (e.g. the Debian config file patch) to Blosxom v2 — the Blosxom developers want to release a Collection of common Blosxom Plugins as a Plugin distribution so that no one needs to gather the often needed plugins from various sites on the net but get them from first hand and also in some kind of a supported way. A first release candidate is on it’s way.
And for those who thought good ol’ blosxom is dead: There never was so much traffic on the blosxom developer’s list like in the past two months — over 160 mails each!
Now playing: Eiffel 65 — Blue
Tagged as: Blosxom, Blosxom Plugin, Blosxom v4, CVS, Hacks, Now Playing, Perl, SourceForge
// show without comments // write a comment
Related stories
Sunday·15·October·2006
wApua now in Debian Unstable //at 00:38 //by abe
Hey, the actual version 0.06 of my Perl written WAP browser wApua now is in Debian Sid!
It’s the first software written by me which has entered the Debian repository as its own package (since pum is included in the package pisg which is in testing now for a while) as well as the first software debianized by me which reached Debian Unstable.
Things are always exciting when they happen the first time. ;-)
Thanks to Myon for sponsoring the package.
Tagged as: Debian, Etch, Hacks, Open Source, Perl, Sid, Tk, WAP, wApua, WML
// show without comments // write a comment
Related stories
Thursday·28·September·2006
wApua 0.06 released //at 03:33 //by abe
I today released version 0.06 of my WAP browser wApua (Release announcement at Freshmeat).
The one big new thing is user friendly documentation: wApua and wbmp2xbm (which has been renamed from wbmp2xbm.pl) now have POD documentation and therefore also man pages. Besides that a lot of minor bugfixes and enhancements complete the new version.
The other big new thing is that there now is a Debian package of wApua. The package should work fine on Debian Woody (3.0), Sarge (3.1) and Etch (upcoming 4.0) and probably also works on other Debian-based distributions like Ubuntu.
Thanks to sponsoring by Christoph “Myon” Berg the Debian package is also in
the Debian
New Queue and hopefully will be included in Debian Etch.
Tagged as: Bugfix, deb, Documentation, Etch, Freshmeat, Hacks, Open Source, Perl, POD, Sarge, Tk, Ubuntu, WAP, wApua, WML, Woody
// show without comments // write a comment
Related stories
wApua 0.05.1 released //at 03:26 //by abe
After more than five years without new release, there is now a new version of Perl written WAP browser wApua: 0.05.1. (Release announcement at Freshmeat)
It mainly fixes the use with newer Tk version as shipped with recent Ubuntu and Gentoo releases (Sarge still works fine with 0.05, but Etch won’t). It also fixes the local installation documentation.
Thanks to all who reported these bugs.
Tagged as: Bugfix, Etch, Freshmeat, Gentoo, Hacks, Open Source, Perl, Sarge, Tk, Ubuntu, WAP, wApua, WML
// show without comments // write a comment
Related stories
Saturday·11·March·2006
Blosxom Plugin Tagging Version 0.02: New Features //at 19:17 //by abe
Just hacked a few new features for my Blosxom plugin Tagging. It now shows you how many times you’ve used that tag. The number is always shown as title attribute to the link, but can optionally also be shown in parentheses behind the tag name or by the (CSS based) font size and/or color (start and end sizes/colors configurable). Also some default values changed (to my current configuration :-).
I saw that font size feature quite often during the last weeks and I liked it. I first tried to figure out, which system offers that feature and found that at least Serendipity’s freetag plugin offers it, but didn’t want to download Serendipity just for the plugin. So I decided, the algorithm for calculating the font sizes shouldn’t be that hard to find and coded it from scratch by my own. :-)
And while coding it I noticed that changing the color instead of the font size could be done the same way and that this feature isn’t much more difficult. So I implemented it, too.
Another new feature is that you now can configure the minimum number of postings a tag should have to show up in the list of tags.
The result can be seen in my blog on the right side under “Tag cloud”.
Now playing: Falco — Der Kommissar
Tagged as: Blogging, Blosxom, Blosxom Plugin, CSS, GPL, Hacks, Now Playing, Open Source, Other Blogs, Perl, Tag Cloud, Tagging
// show without comments // write a comment