From 1687fc31519b3f67e07a6b221b095830b12f78a3 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Fri, 1 Jul 2022 11:22:18 +0200 Subject: [PATCH] Add support for x11 --- data/org.smolnet.passui.desktop | 2 +- src/pass_handler/__init__.py | 10 ++++++++-- stdeb.cfg | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 stdeb.cfg diff --git a/data/org.smolnet.passui.desktop b/data/org.smolnet.passui.desktop index c3bd3bb..06e9a9b 100644 --- a/data/org.smolnet.passui.desktop +++ b/data/org.smolnet.passui.desktop @@ -10,7 +10,7 @@ Comment=GUI for the standard unix password store Comment[ca]=Interfície gràfica per al magatzem de contrasenyes UNIX estàndard Comment[nl]=GUI voor de standaard Unix wachtwoordopslag Comment[sv_SE]=GUI för Unix standardlösenordshanterare -Exec=/usr/local/bin/passui +Exec=/usr/bin/passui Icon=dialog-password Terminal=false Categories=Security;Utility; diff --git a/src/pass_handler/__init__.py b/src/pass_handler/__init__.py index 05980ee..d1b5524 100644 --- a/src/pass_handler/__init__.py +++ b/src/pass_handler/__init__.py @@ -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 diff --git a/stdeb.cfg b/stdeb.cfg new file mode 100644 index 0000000..d4aec8e --- /dev/null +++ b/stdeb.cfg @@ -0,0 +1,4 @@ +[DEFAULT] +Depends3: python3-wxgtk4.0, python3-typing-extensions, python3-typing-inspect, python3-gnupg, git, gnupg, pass, pinentry-gtk2, wl-clipboard | xclip +Debian-Version: 1 +Package3: passui