From c23f469e05f4c07acf07dac7b1456c54230a26be Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Sun, 12 Jan 2025 16:12:32 +0100 Subject: [PATCH] [kitty] Update hints to copy the values instead of inserting them --- .config/kitty/kitty.conf | 2 ++ .config/kitty/secrets.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 59ebf2b..ac37574 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -85,6 +85,8 @@ listen_on unix:@mykitty map F1 launch --allow-remote-control kitty +kitten broadcast map ctrl+alt+p kitten secrets.py "description" "Kitty password" +map kitty_mod+p>f kitten hints --type path --program @ map kitty_mod+p>l kitten hints --type line --program @ +map kitty_mod+p>w kitten hints --type word --program @ #: }}} diff --git a/.config/kitty/secrets.py b/.config/kitty/secrets.py index e19ead0..a4aff1b 100644 --- a/.config/kitty/secrets.py +++ b/.config/kitty/secrets.py @@ -19,7 +19,7 @@ from kitty.boss import Boss def main(args: List[str]) -> Optional[str]: secrets = get_secret_names(args[1], args[2]) - entries = WordCompleter(secrets) + entries = WordCompleter(list(secrets.keys())) session = PromptSession(completer=entries) try: entry = session.prompt('> ', pre_run=expand_prompt) @@ -54,7 +54,7 @@ def get_secret_names(attribute: str, value: str) -> Dict[str, str]: return secrets -def handle_result(args: List[str], answer: str, target_window_id: int, boss: Boss) -> None: +def handle_result(_: List[str], answer: str, target_window_id: int, boss: Boss) -> None: window = boss.window_id_map.get(target_window_id) if window is not None: window.paste(answer)