- exit with a non-zero status code when dbus-send fails.
If awesome does not respond to the D-Bus message, e.g. because it is not
running (yet), awesome-client now returns with a non-zero return code.
This can be used to check if awesome has finished starting up, which is
meant to be used for the functional test runner.
- changed the shebang to use bash directly, which simplifies the logic
to detect/handle "bash as /bin/sh" and allows to use `set -o pipefail`
(which makes handling the D-Bus error easier - without using a subshell).
- fix the prompt: now with trailing space, and the prompt is actually used
(which wasn't the case with /bin/sh not pointing at bash before).
Closes https://github.com/awesomeWM/awesome/pull/304.
-e and -p options for read are bashizm, so awesome-client don't work
if /bin/sh is something other than bash (for example it fails with
pdksh which is default shell on PLD Linux).
The simplest sollution is 's,#!/bin/sh,#!/bin/bash,'. But I believe
that it is better to patch script so it will work with any POSIX
compliant shell.
Attached patch checks if shell is bash. If no it disables use of
non-standard read options.
I've also changed `` to $(), as backquotes are obsolete and
shouldn't be used.
Signed-off-by: Julien Danjou <julien@danjou.info>
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 <psychon@znc.in>