15 lines
333 B
Lua
15 lines
333 B
Lua
local helpers = require("lain.helpers")
|
|
|
|
local utils = {}
|
|
|
|
function utils.home()
|
|
return os.getenv("HOME") .. "/"
|
|
end
|
|
|
|
function utils.handle_pid(command, callback)
|
|
helpers.async_with_shell(string.format("ps x -o pid=,command=|grep -E '^\\s*[0-9]* %s$'|sed 's/\\s*\\([0-9]*\\) .*/\\1/'", command), callback)
|
|
end
|
|
|
|
|
|
return utils
|