Skip to content

Instantly share code, notes, and snippets.

@meeuw
Created February 22, 2016 10:46
Show Gist options
  • Select an option

  • Save meeuw/f37accdcf54a51f1262c to your computer and use it in GitHub Desktop.

Select an option

Save meeuw/f37accdcf54a51f1262c to your computer and use it in GitHub Desktop.
Well, this requires some explaination :-) I don't like password less sudo because I'd like to have some confirmation before executing a sudo command. I've bound this script to a keyboard button so I can enter a hard to guess password at my command.
import subprocess
import time
time.sleep(.2)
password = subprocess.check_output(['secret-tool', 'lookup', 'keyboard', 'play'])
subprocess.call(['xdotool', 'type', password])
subprocess.call(['xdotool', 'key', 'Return'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment