Skip to content

Instantly share code, notes, and snippets.

@ekovac
ekovac / gist:3137790
Created July 18, 2012 18:05
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
@ekovac
ekovac / term-pwd.py
Created April 4, 2012 20:16
A utility for determining the current working directory of a shell running inside an xterm or other terminal emulator on X
#!/usr/bin/python
"""
term-pwd
a utility for determining the current working directory of a shell running inside an xterm or other terminal emulator on X
"""
import argparse
import sys
import os
import os.path
import re