For your information, using "tr" instead of "xargs echo" should remove
the string size limit, since the string isn't passed as argument :

echo '
if something == anything then
  do_something
end
' | tr '\n' ' ' | awesome-client

2010/12/16 Manner Robert <rma...@gmail.com>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I had an idea about moving part of my rc.lua functionality into scripts
> running through awesome-client. However, as I see awesome-client is
> sending the commands line by line, so what I send through it has to have
> a meaning for each line. This makes it somehow limited and unsuitable
> for this purpose.
>
> Here is an example, I would do:
>
> echo "
> if something == anything then
>    do_something
> end
> " | awesome-client
>
> It says for the first line that "error end is missing", executes the
> second line, and says another error for the 3rd. This can be overcome by
> sending it in one line since lua is quite flexible about newlines :)
>
> echo "
> if something == anything then
>    do_something
> end
> " | xargs echo | awesome-client
>
> I guess I do not have to explain why I do not like this, it has
> limitation on the size of the program as argument count is limited, it
> modifies the program (removes quotation marks, apostrophes) etc.
>
> I am wandering how cool it was if I could write awesome scripts like any
> other scripts:
>
> #! /usr/bin/awesome-client
> - -- lua code comes here
>
> Or, it would be much better if we could communicate with awesome through
> a local socket or a pipe and send to it programs to execute. Is this
> already possible / do you plan such?
>
> Thanks for all your work,
>
> Manner Robert
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNCezMAAoJEFxyEaJhvswtn2YH/0votAXlrr8YiywGVOdtexUB
> uUKvh6W026HFKKXQs6VsMlMYira6eQV4UdNypGRptRSlvDG6Slvf+YgHxwFPDnZ8
> Nzr0a01fj+cgIbac8OM9wSSPxArPshZIg711EWgzKEOq+3TjlS0Fh6OubXtZRKK3
> TrVeuAIdQaPEoRFmTHwmY6rYs4mGm/Iro8jHftNVl4YTcyM4WvEW/rDEX8fO1ga+
> iLt7gF9AHbHztbIjaae0zFXBdU9Y4W16b2EBwoVd8htgWzf77Hur+TeClMz8+hLU
> M6Fj3sryXdgwEUniWP9M3EhDON657UU0s1PmWvnGPV/t7ciG7BNKcx8sGzsINFk=
> =F0Z+
> -----END PGP SIGNATURE-----
>
> --
> To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.
>



-- 
Vivian Brégier
http://www.are-ata.org/Vivian.vcf

--
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to