Example #1
0
def create_passwords():
    apg_bin = lookup_path('apg')
    pipe = subprocess.Popen([apg_bin, "-MNSC"], stdout=subprocess.PIPE)
    options = list()
    for l in pipe.stdout.xreadlines():
        options.append(l)
    return options
Example #2
0
def paste(active_win):
    paste_cmd = 'ctrl+v'
    xdo_bin = lookup_path('xdotool')
    xdo_cmd = xdo_bin + ' search "%s" windowactivate --sync key --clearmodifiers %s'
    p = subprocess.Popen(xdo_cmd % (active_win, paste_cmd)
                        ,stdout=subprocess.PIPE 
                        ,stderr=subprocess.PIPE
                        ,shell=True)
    output, errors = p.communicate()