From ba2521bec22cd219888bb9228486516be55f2cca Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 24 Mar 2022 18:39:51 -0400 Subject: [PATCH] pass_typer: Match just server part of user@server for aliases --- .config/i3/pass_typer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.config/i3/pass_typer.py b/.config/i3/pass_typer.py index 4330c42..1658977 100755 --- a/.config/i3/pass_typer.py +++ b/.config/i3/pass_typer.py @@ -15,11 +15,11 @@ cmd = partial(subprocess.run, capture_output=True, encoding="ascii") def alias(server_name): - match server_name: - case "salt": - return "cms-net-svcs" - case "iPad1" | "iPad2" | "iPad3": - return "ipads" + match server_name.rpartition("@"): + case [_, _, "salt"]: + return 'cms/*cms-net-svcs' + case [_, _, ("iPad1" | "iPad2" | "iPad3")]: + return 'cms/*ipads' case _: return server_name