mirror of
https://github.com/rwinkhart/sshyp-labs.git
synced 2026-09-05 16:47:29 -04:00
sshyp-mfa - Update to newer clipboard methods for WSL and Wayland
This commit is contained in:
@@ -85,9 +85,9 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
_mfa_key = totp(mfa_data[1], mfa_data[2], mfa_data[3], mfa_data[4])
|
_mfa_key = totp(mfa_data[1], mfa_data[2], mfa_data[3], mfa_data[4])
|
||||||
if 'WSL_DISTRO_NAME' in environ: # WSL clipboard detection
|
if 'WSL_DISTRO_NAME' in environ: # WSL clipboard detection
|
||||||
run(('powershell.exe', '-c', 'Set-Clipboard', _mfa_key))
|
run(('powershell.exe', '-c', "Set-Clipboard '" + _mfa_key + "'"))
|
||||||
elif 'WAYLAND_DISPLAY' in environ: # Wayland clipboard detection
|
elif 'WAYLAND_DISPLAY' in environ: # Wayland clipboard detection
|
||||||
run(('wl-copy', _mfa_key))
|
run('wl-copy', stdin=Popen(('printf', _mfa_key), stdout=PIPE).stdout)
|
||||||
elif uname()[0] == 'Haiku': # Haiku clipboard detection
|
elif uname()[0] == 'Haiku': # Haiku clipboard detection
|
||||||
run(('clipboard', '-c', _mfa_key))
|
run(('clipboard', '-c', _mfa_key))
|
||||||
elif uname()[0] == 'Darwin': # MacOS clipboard detection
|
elif uname()[0] == 'Darwin': # MacOS clipboard detection
|
||||||
|
|||||||
Reference in New Issue
Block a user