mirror of
https://github.com/rwinkhart/sshyp-labs.git
synced 2026-09-05 16:47:29 -04:00
MFA key is now copied to clipboard once before the counter starts, fixes issue #1
This commit is contained in:
@@ -50,16 +50,19 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
gpg = 'gpg'
|
gpg = 'gpg'
|
||||||
|
|
||||||
|
# main process
|
||||||
try:
|
try:
|
||||||
|
|
||||||
if len(argument_list) == 1:
|
if len(argument_list) == 1:
|
||||||
entry_list_gen()
|
entry_list_gen()
|
||||||
argument_list.append(input('entry to read: '))
|
argument_list.append(input('entry to read: '))
|
||||||
mfa_data = mfa_read_shortcut()
|
mfa_data, copied = mfa_read_shortcut(), None
|
||||||
print('\nmfa key copied to clipboard\n\nuntil this process is closed, your clipboard will be automatically '
|
print('\nmfa key copied to clipboard\n\nuntil this process is closed, your clipboard will be automatically '
|
||||||
'updated with the newest mfa key')
|
'updated with the newest mfa key')
|
||||||
while True:
|
while True:
|
||||||
sleep(1)
|
if str(int(strftime('%S'))/15).endswith('.0') or copied is None:
|
||||||
if str(int(strftime('%S'))/15).endswith('.0'):
|
if copied is None:
|
||||||
|
copied = 1
|
||||||
if mfa_data[0] == 'steam':
|
if mfa_data[0] == 'steam':
|
||||||
_mfa_key = steam_totp(b32decode(mfa_data[1]))
|
_mfa_key = steam_totp(b32decode(mfa_data[1]))
|
||||||
else:
|
else:
|
||||||
@@ -72,6 +75,8 @@ if __name__ == '__main__':
|
|||||||
system(f"wl-copy '{_mfa_key}'")
|
system(f"wl-copy '{_mfa_key}'")
|
||||||
else: # X11 clipboard detection
|
else: # X11 clipboard detection
|
||||||
system(f"echo -n '{_mfa_key}' | xclip -sel c")
|
system(f"echo -n '{_mfa_key}' | xclip -sel c")
|
||||||
|
sleep(1)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('\n')
|
print('\n')
|
||||||
s_exit()
|
s_exit()
|
||||||
|
|||||||
Reference in New Issue
Block a user