From d64e59ec9b45d87eb28854583770e1c2e6cc3f0a Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 12 Apr 2022 11:41:51 -0400 Subject: [PATCH] pass_typer: Avoid error when no password is selected --- .config/i3/pass_typer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/i3/pass_typer.py b/.config/i3/pass_typer.py index 65a18bd..acdee02 100755 --- a/.config/i3/pass_typer.py +++ b/.config/i3/pass_typer.py @@ -53,9 +53,10 @@ def select_and_type(server_name: Path) -> None: ) selected = rofi_select(file_list) - password = get_password(selected) + if selected: + password = get_password(selected) - subprocess.run(["xdotool", "type", password + "\n"]) + subprocess.run(["xdotool", "type", password + "\n"]) window_name = cmd(["xdotool", "getactivewindow", "getwindowname"]).stdout.strip()