1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2025-01-10 17:58:09 +00:00
awesome-copycats/myrc/run_once.lua
2014-05-10 18:24:30 -04:00

11 lines
268 B
Lua

local awful = require("awful")
function run_once(cmd)
findme = cmd
firstspace = cmd:find(" ")
if firstspace then
findme = cmd:sub(0, firstspace-1)
end
awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")")
end