Created
February 22, 2016 10:46
-
-
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.
This file contains hidden or 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
| 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