-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

the old C version of awesome-client used readline which provided nice line
editing and history. With the switch to a shell script as awesome-client, this
was lost.

Julien showed me rlwrap and I made a small patch to make awesome-client use
rlwrap, if it is available. This works fine here with both bash and dash.

Opinions? Is this merge worthy? (Is the color stuff merge worthy? ;)
Should it be documented somewhere that awesome-client can take advantage of
rlwrap? If yes, where?

Uli

P.S.:
git://git.znc.in/psychon/awesome.git rlwrap
and
http://git.znc.in/?p=psychon/awesome.git;a=commitdiff;h=60595c55c
- --
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknprPgACgkQABixOSrV99/wjwCfQUPXYm8ekmNl32n19w3w5tqS
bAYAni9zKFfqNaIhzcjdvcFxJPBr5AWB
=KZiS
-----END PGP SIGNATURE-----
>From 60595c55cbe64de8f34f5084b3517c85a1d7d1af Mon Sep 17 00:00:00 2001
From: Uli Schlachter <[email protected]>
Date: Sat, 18 Apr 2009 12:26:31 +0200
Subject: [PATCH] awesome-client: Use rlwrap if it is available

This should make this more usable again. The old C version used readline, if
possible and now the new bash version does too. :)

The idea to use rlwrap is from jd and it's a good one.

Signed-off-by: Uli Schlachter <[email protected]>
---
 utils/awesome-client |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/utils/awesome-client b/utils/awesome-client
index 4b027cb..ea3971c 100755
--- a/utils/awesome-client
+++ b/utils/awesome-client
@@ -1,5 +1,13 @@
 #!/bin/sh
 
+# rlwrap provides readline to stuff which doesn't know readline by itself
+RLWRAP=`which rlwrap 2>/dev/null`
+
+if [ "$RLWRAP" != "" ] && [ "$A_RERUN" = "" ]
+then
+	A_RERUN="no" exec $RLWRAP $0
+fi
+
 DBUS_SEND=dbus-send
 
 if ! which ${DBUS_SEND} >/dev/null 2>&1
-- 
1.6.2.1

Reply via email to