From 6e983b6b7a0f6b3662a6aa24c39d9c5297978728 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Fri, 3 May 2024 21:54:04 +0200 Subject: [PATCH] Vault and uri shortcuts --- gui/src/gui/quickaccess.py | 19 +++++++++++-------- gui/src/gui/shortcuts.blp | 14 +++++--------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/gui/src/gui/quickaccess.py b/gui/src/gui/quickaccess.py index 62e35af..9ed95e7 100644 --- a/gui/src/gui/quickaccess.py +++ b/gui/src/gui/quickaccess.py @@ -43,8 +43,6 @@ class GoldwardenQuickAccessApp(Adw.Application): self.window.add_controller(evk) def key_press(self, event, keyval, keycode, state): - print(keyval, keycode) - if keyval == Gdk.KEY_Escape: os._exit(0) @@ -73,28 +71,33 @@ class GoldwardenQuickAccessApp(Adw.Application): # totp code if keyval == Gdk.KEY_t or keyval == Gdk.KEY_T: if auto_type_combo: - print("TOTP type") self.autotype(totp.totp(self.filtered_logins[self.selected_index]["totp"])) if copy_combo: - print("TOTP copy") self.set_clipboard(totp.totp(self.filtered_logins[self.selected_index]["totp"])) if keyval == Gdk.KEY_u or keyval == Gdk.KEY_U: if auto_type_combo: - print("Username type") self.autotype(self.filtered_logins[self.selected_index]["username"]) if copy_combo: - print("Username copy") self.set_clipboard(self.filtered_logins[self.selected_index]["username"]) if keyval == Gdk.KEY_p or keyval == Gdk.KEY_P: if auto_type_combo: - print("Password type") self.autotype(self.filtered_logins[self.selected_index]["password"]) if copy_combo: - print("Password copy") self.set_clipboard(self.filtered_logins[self.selected_index]["password"]) + if (keyval == Gdk.KEY_l or keyval == Gdk.KEY_L) and auto_type_combo: + Gtk.show_uri(None, self.results_list.get_selected_row().uri, Gdk.CURRENT_TIME) + + if (keyval == Gdk.KEY_v or keyval == Gdk.KEY_V) and auto_type_combo: + self.set_clipboard(self.filtered_logins[self.selected_index]["uri"]) + environment = goldwarden.get_environment() + if environment == None: + return + item_uri = environment["vault"] + "#/vault?itemId=" + self.results_list.get_selected_row().uuid + Gtk.show_uri(None, item_uri, Gdk.CURRENT_TIME) + if keyval == Gdk.KEY_Return: if auto_type_combo: self.autotype(f"{self.filtered_logins[self.selected_index]['username']}\t{self.filtered_logins[self.selected_index]['password']}") diff --git a/gui/src/gui/shortcuts.blp b/gui/src/gui/shortcuts.blp index ff3994a..3c3d53f 100644 --- a/gui/src/gui/shortcuts.blp +++ b/gui/src/gui/shortcuts.blp @@ -39,7 +39,7 @@ Adw.Window window { } Adw.ActionRow { title: "Autotype Username Shortcut"; - subtitle: "CTRL + ALT + U"; + subtitle: "CTRL + SHIFT + U"; } Adw.ActionRow { title: "Copy Password Shortcut"; @@ -47,7 +47,7 @@ Adw.Window window { } Adw.ActionRow { title: "Autotype Password Shortcut"; - subtitle: "CTRL + ALT + P"; + subtitle: "CTRL + SHIFT + P"; } Adw.ActionRow { title: "Copy TOTP Shortcut"; @@ -55,19 +55,15 @@ Adw.Window window { } Adw.ActionRow { title: "Autotype TOTP Shortcut"; - subtitle: "CTRL + ALT + T"; + subtitle: "CTRL + SHIFT + T"; } Adw.ActionRow { title: "Launch URI Shortcut"; - subtitle: "CTRL + L"; + subtitle: "CTRL + SHIFT + L"; } Adw.ActionRow { title: "Launch Web Vault Shortcut"; - subtitle: "CTRL + V"; - } - Adw.ActionRow { - title: "Focus Search Shortcut"; - subtitle: "F"; + subtitle: "CTRL + SHIFT + V"; } Adw.ActionRow { title: "Quit Shortcut";