Skip to content

Instantly share code, notes, and snippets.

@ekovac
Created July 18, 2012 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekovac/3137790 to your computer and use it in GitHub Desktop.
Save ekovac/3137790 to your computer and use it in GitHub Desktop.
Snippet for AwesomeRC to "Toggle" a process
toggle_pids = {}
function toggle_process(cmd)
pid = toggle_pids[cmd]
if (pid == nil) then
pid = awful.util.spawn(cmd)
else
awful.util.spawn("kill " .. pid)
pid = nil
end
toggle_pids[cmd] = pid
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment