X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/5f1d675dfabe09c56cc3f621ed76d17b29e2bae0..d99ce8fdba3d86c7837a1ee60c398fa477365eab:/helpers.lua diff --git a/helpers.lua b/helpers.lua index 7fa8564..ab87f76 100644 --- a/helpers.lua +++ b/helpers.lua @@ -5,7 +5,7 @@ --]] -local easy_async = require("awful.spawn").easy_async +local spawn = require("awful.spawn") local timer = require("gears.timer") local debug = require("debug") local io = { lines = io.lines, @@ -110,7 +110,15 @@ end -- @param callback function to execute on cmd output -- @return cmd PID function helpers.async(cmd, callback) - return easy_async(cmd, + return spawn.easy_async(cmd, + function (stdout, stderr, reason, exit_code) + callback(stdout) + end) +end + +-- like above, but call spawn.easy_async with a shell +function helpers.async_with_shell(cmd, callback) + return spawn.easy_async_with_shell(cmd, function (stdout, stderr, reason, exit_code) callback(stdout) end)