Exercise in futility … err … zenity

August 20th, 2008 by shashi

The other day, while working with some shell scripts I thought I could add some better usability into the mix – and hence whip up some dialogs using zenity (gdialog’s new avatar). And while at it, I had an enjoyable 20 minutes with good old unix concepts. Here:

I needed to figure out how to use zenity, the man pages didn’t tell much. So I went on a hunt for other scripts in the system that might use zenity; I was on Debian Etch system running the usual Gnome Desktop and quite a few applications from the Gnome bunch.


shashi@anacoluthon:~$ for p in `echo $PATH|sed 's/:/ /g'`; do find $p -type f|xargs grep -il zenity; done
/usr/bin/zenity
/usr/bin/gdialog

Eh! Only two programs and that too zenity itself and a wrapper over zenity for backward compliance. It’s not much popular is it ? If it isn’t why don’t I remove it from my system ?

$ su -c 'apt-get remove zenity'
Password:
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED:
gnome-desktop-environment zenity

uh! oh!! gnome-desktop-environment!!!??? WTF ? So, what dependencies does this package have ?

shashi@anacoluthon:~$ apt-cache rdepends zenity
zenity
Reverse Depends:
|ssft
gnuvd-gnome
|peercast-handlers
|eclipse-platform
eclipse-platform
eclipse
gnomemeeting
powersaved
gdm
gnome-desktop-environment

heh! heh!! So much for a core dependency. Should it be such a core dependency in the first place ?? Anyway it has it’s own place in the software trove.

An interesting tidbit about zenity. This was the first program I translated to Kannada way back in 2002-2003. But it never made it to the repository.

BTW, another interesting program: PySchoolClock

Truly Plural!

June 22nd, 2007 by shashi

I was working on a small shell script to generate stubs for a project we’re working on. After arriving at a rough design and deciding on the class names, method names to be generated, I started generating the stubs (scaffolding?). And came across an amusing non technical issue. getBench() was fine, but getBenchs() wasn’t. It should’ve been getBenches().

Uh, oh! There might be a tool that can generate plurals given a word ?

Doing a quick search threw up a perl library to achieve the same. Three cheers for Perl !!! I’m always amazed at the huge number of modules Perl has. Anyway’s here’s a simple wrapper I wrote for that library which you can use to get plurals for most nouns.

shashi@anacoluthon:~$ pluralize.pl bench
benches

While at it, I happened to notice there’s an implementation for Python and also a Grammar ruleset for implementing elsewhere.

PS: Title Inspiration: “A truly rural frugal ruler’s mural” – tongue twister