2014-12-19 00:26:04 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Reading input {{{
|
|
|
|
|
|
|
|
# Terminal
|
|
|
|
#read -p "Alias: " alias_
|
|
|
|
#read -s -p "Secret: " secret
|
|
|
|
|
|
|
|
# GUI
|
2016-09-09 17:17:03 +02:00
|
|
|
pair="$(zenity --password --username --title="Password Calculator" 2> /dev/null)"
|
2014-12-19 00:26:04 +01:00
|
|
|
alias_="${pair%|*}"
|
|
|
|
secret="${pair#*|}"
|
|
|
|
|
2015-12-30 10:29:56 +01:00
|
|
|
pass="$(echo -n "$secret$alias_" | shasum | sed 's/../\\\\x&/g' | xargs echo -e | base64 | colrm 17)"
|
2014-12-19 00:26:04 +01:00
|
|
|
|
|
|
|
echo -n "$pass" | xclip
|
2015-05-18 14:16:43 +02:00
|
|
|
echo -n "$pass" | xclip -sel c
|
2014-12-19 00:26:04 +01:00
|
|
|
notify-send "xclip set to ${pass:0:3}...${pass:(-3):3}"
|
|
|
|
|
2016-02-01 09:18:34 +01:00
|
|
|
sleep 2
|
|
|
|
cat -A /dev/urandom | head -c10 | xclip
|
|
|
|
cat -A /dev/urandom | head -c10 | xclip -sel c
|
|
|
|
notify-send "cleaned xclip"
|
|
|
|
|