add xdopass and update gitignore

This commit is contained in:
Felix Van der Jeugt 2017-11-29 17:31:11 +01:00
parent 15dccb6a24
commit f81c279b7e
No known key found for this signature in database
GPG Key ID: 58B209295023754D
2 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,9 @@ tox-quickstart
hlint hlint
stylish-haskell stylish-haskell
unlit unlit
vis
vis-*
cabal
# shouldn't share this one with the world # shouldn't share this one with the world
macaddress macaddress

11
local/bin/xdopass Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
window="$(xdotool getwindowfocus)"
alias_="$(zenity --password --title="Password Calculator - Alias" 2> /dev/null)"
secret="$(zenity --password --title="Password Calculator - Secret" 2> /dev/null)"
pass="$(echo -n "$secret$alias_" | shasum | sed 's/../\\\\x&/g' | xargs echo -e | base64 -w16 | head -1)"
xdotool type --window "$window" "$pass"
xdotool windowfocus "$window"