Vault and uri shortcuts

This commit is contained in:
Bernd Schoolmann 2024-05-03 21:54:04 +02:00
parent 171d833a83
commit 6e983b6b7a
No known key found for this signature in database
2 changed files with 16 additions and 17 deletions

View File

@ -43,8 +43,6 @@ class GoldwardenQuickAccessApp(Adw.Application):
self.window.add_controller(evk) self.window.add_controller(evk)
def key_press(self, event, keyval, keycode, state): def key_press(self, event, keyval, keycode, state):
print(keyval, keycode)
if keyval == Gdk.KEY_Escape: if keyval == Gdk.KEY_Escape:
os._exit(0) os._exit(0)
@ -73,28 +71,33 @@ class GoldwardenQuickAccessApp(Adw.Application):
# totp code # totp code
if keyval == Gdk.KEY_t or keyval == Gdk.KEY_T: if keyval == Gdk.KEY_t or keyval == Gdk.KEY_T:
if auto_type_combo: if auto_type_combo:
print("TOTP type")
self.autotype(totp.totp(self.filtered_logins[self.selected_index]["totp"])) self.autotype(totp.totp(self.filtered_logins[self.selected_index]["totp"]))
if copy_combo: if copy_combo:
print("TOTP copy")
self.set_clipboard(totp.totp(self.filtered_logins[self.selected_index]["totp"])) self.set_clipboard(totp.totp(self.filtered_logins[self.selected_index]["totp"]))
if keyval == Gdk.KEY_u or keyval == Gdk.KEY_U: if keyval == Gdk.KEY_u or keyval == Gdk.KEY_U:
if auto_type_combo: if auto_type_combo:
print("Username type")
self.autotype(self.filtered_logins[self.selected_index]["username"]) self.autotype(self.filtered_logins[self.selected_index]["username"])
if copy_combo: if copy_combo:
print("Username copy")
self.set_clipboard(self.filtered_logins[self.selected_index]["username"]) self.set_clipboard(self.filtered_logins[self.selected_index]["username"])
if keyval == Gdk.KEY_p or keyval == Gdk.KEY_P: if keyval == Gdk.KEY_p or keyval == Gdk.KEY_P:
if auto_type_combo: if auto_type_combo:
print("Password type")
self.autotype(self.filtered_logins[self.selected_index]["password"]) self.autotype(self.filtered_logins[self.selected_index]["password"])
if copy_combo: if copy_combo:
print("Password copy")
self.set_clipboard(self.filtered_logins[self.selected_index]["password"]) 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 keyval == Gdk.KEY_Return:
if auto_type_combo: if auto_type_combo:
self.autotype(f"{self.filtered_logins[self.selected_index]['username']}\t{self.filtered_logins[self.selected_index]['password']}") self.autotype(f"{self.filtered_logins[self.selected_index]['username']}\t{self.filtered_logins[self.selected_index]['password']}")

View File

@ -39,7 +39,7 @@ Adw.Window window {
} }
Adw.ActionRow { Adw.ActionRow {
title: "Autotype Username Shortcut"; title: "Autotype Username Shortcut";
subtitle: "CTRL + ALT + U"; subtitle: "CTRL + SHIFT + U";
} }
Adw.ActionRow { Adw.ActionRow {
title: "Copy Password Shortcut"; title: "Copy Password Shortcut";
@ -47,7 +47,7 @@ Adw.Window window {
} }
Adw.ActionRow { Adw.ActionRow {
title: "Autotype Password Shortcut"; title: "Autotype Password Shortcut";
subtitle: "CTRL + ALT + P"; subtitle: "CTRL + SHIFT + P";
} }
Adw.ActionRow { Adw.ActionRow {
title: "Copy TOTP Shortcut"; title: "Copy TOTP Shortcut";
@ -55,19 +55,15 @@ Adw.Window window {
} }
Adw.ActionRow { Adw.ActionRow {
title: "Autotype TOTP Shortcut"; title: "Autotype TOTP Shortcut";
subtitle: "CTRL + ALT + T"; subtitle: "CTRL + SHIFT + T";
} }
Adw.ActionRow { Adw.ActionRow {
title: "Launch URI Shortcut"; title: "Launch URI Shortcut";
subtitle: "CTRL + L"; subtitle: "CTRL + SHIFT + L";
} }
Adw.ActionRow { Adw.ActionRow {
title: "Launch Web Vault Shortcut"; title: "Launch Web Vault Shortcut";
subtitle: "CTRL + V"; subtitle: "CTRL + SHIFT + V";
}
Adw.ActionRow {
title: "Focus Search Shortcut";
subtitle: "F";
} }
Adw.ActionRow { Adw.ActionRow {
title: "Quit Shortcut"; title: "Quit Shortcut";