Created
July 18, 2012 18:05
-
-
Save ekovac/3137790 to your computer and use it in GitHub Desktop.
Snippet for AwesomeRC to "Toggle" a process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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