awesome-client.c manipulates the string returned from getenv("DISPLAY"),
removing anything after the first dot ('.'). awesome.c however has no
such thing, leading to awesome listening on a '...0.0' socket. Anyway,
this seems like something that should be in get_client_addr as opposed
to hardwired in awesome-client.c or awesome.c. The attached patch moves
it into awesome-client-common.c:get_client_addr() and teaches
awesome-client.c of the change.
As discussed on #awesome, the attached patch makes awesome-client exit
with a meaningful value (i.e. that of errno) when it encounters an
error. Since the most frequent error with awesome-client is a mismatch
in the socket path, there is an explicit case for ENOENT errors. I
thought of adding a matching fprintf in awesome.c, but you can tell what
socket awesome is listening on by looking at what ~/.awesome_ctl.* file
you have.
CAVEAT: Exiting on error may break setups such as:
while true; do
echo "some text"
done | /path/to/awesome-client
which relied on awesome-client continuing to send to the given socket
(although failing) until EOF was encountered on stdin.