I'm sold to Beryl

Posted by F 31/01/2007 at 19h27

I’ve been trying Beryl (a 3D Window Manager for X) and I’m pretty impressed.

True, it’s full of useless graphical effects and pure eye-candy. But it also provides practical features and is very configurable.

Among the actually useful things: fast and practical ways to change windows, desktops, to expose the desktop area, scale and pick a window (ala Mac OS X’s “exposé”), visual notifications, desktop zoom, screen annotations.

Unfortunately, most demo videos concentrate on the graphical effects instead of the useful features, but they still give you an idea of what it can do.

I really like the idea of using a “water-ripple” effect as an unobtrusive -but impossible to miss- way of receiving notifications.

It integrates nicely with KDE, Gnome and pretty much any desktop environment. And you can easily switch back to your previous window manager at any time on-the-fly.

I have it running on my work laptop, with Fedora 6, KDE and AIGLX.

Very nice.

History and auto-completion with rlwrap 4

Posted by F 18/01/2007 at 23h06

If you ever used Oracle’s sqlplus you’d agree that it provides an arcane command-line interface.

Being a textmode command-line tool is not what makes it arcane though. It’s that it doesn’t offer auto-completion or a command history. If you made a small mistake when typing a long statement, you would have to re-enter it all over again.

Most modern command-line tools (including MySQL and PostgreSQL’s equivalent to Oracle’s sqlplus) provide much more powerful interfaces, just like the bash shell does. They include auto-completion of the text you are typing (by pressing TAB), access to a history of commands (up/down arrows, or C-p/C-n), incremental search on the history (C-r), they remember the history in between invocations and more. Virtually all these tools use the GNU readline library to provide these capabilities.

Unfortunately, not all command-line tools use GNU readline (splplus being one). Fortunately, there’s rlwrap. I just came to know this nice little tool.

rlwrap “wraps” any other command-line tool and gives you a readline interface to it. So, you can invoke rlwrap sqlplus and you get sqlplus with the history capabilities of the readline library.

You may also pass to rlwrap a list of potential words to use for completion. For example, I also use rlwrap with groovysh (the Groovy language shell), so I created a file “~/.groovysh_completions” containing the list of commands groovysh accepts. Now, when I launch groovysh I get command history and specialized auto-completion.

Now, rlwrap cannot do magic. Being so generic, it cannot do intelligent context-dependent auto-completion. For instance, PostgreSQL’s command-line interface automatically pulls the list of potential table names after doing SELECT * FROM <TAB>. rlwrap cannot give this intelligence to sqlplus, but it’s still much better than nothing.