|
|
|
@ -99,9 +99,12 @@ def copy_to_clipboard(text) -> tuple[Union[str, bytes], Union[str, bytes]]:
|
|
|
|
|
|
|
|
|
|
:param text:
|
|
|
|
|
"""
|
|
|
|
|
clip_command = ['/usr/bin/wl-copy']
|
|
|
|
|
if not os.path.isfile(clip_command[0]):
|
|
|
|
|
clip_command = ['xclip', '-selection', 'c']
|
|
|
|
|
password: str = text.split('\n')[0]
|
|
|
|
|
command1: list[str] = ['/bin/echo', password]
|
|
|
|
|
command2: list[str] = ['/usr/bin/wl-copy']
|
|
|
|
|
command2: list[str] = clip_command
|
|
|
|
|
result: tuple[Union[str, bytes], Union[str, bytes]] = run_command(command1, command2)
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
@ -112,7 +115,10 @@ def get_password_from_path(pass_path) -> str:
|
|
|
|
|
:param pass_path:
|
|
|
|
|
"""
|
|
|
|
|
result: tuple[Union[str, bytes], Union[str, bytes]] = run_command(['/usr/bin/pass', 'show', pass_path])
|
|
|
|
|
password: str = result[0].decode()
|
|
|
|
|
if type(result[0]) == type(bytes()):
|
|
|
|
|
password: str = result[0].decode()
|
|
|
|
|
else:
|
|
|
|
|
password: str = result[0]
|
|
|
|
|
return password
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|