X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6714db710a53b3c13d4526dcd922e1333ca6c1af..0c8671085b94a0e7b31f33c146695fb134f5a4e7:/asyncshell.lua diff --git a/asyncshell.lua b/asyncshell.lua index 51885e8..4a01caa 100644 --- a/asyncshell.lua +++ b/asyncshell.lua @@ -11,9 +11,9 @@ -- ...asynchronously: -- asyncshell.request('wscript -Kiev', function(f) wwidget.text = f:read("*l") end) -- ...synchronously --- wwidget.text = asyncshell.demand('wscript -Kiev', 5):read("*l") or "Error" +-- widget:set_text(asyncshell.demand('wscript -Kiev', 5):read("*l") or "Error") --- This makes things faster, but puts weight on sysload and is more cpu demanding. +-- This is more cpu demanding, but makes things faster. local spawn = require('awful.util').spawn @@ -39,7 +39,7 @@ end function asyncshell.request(command, callback) local id = next_id() local tmpfname = asyncshell.file_template .. id - asyncshell.request_table[id] = {callback = callback} + asyncshell.request_table[id] = { callback = callback } local req = string.format("sh -c '%s > %s; " .. 'echo "asyncshell.deliver(%s)" | ' ..