1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-01-21 07:16:46 +00:00

[kitty] Update hints to copy the values instead of inserting them

This commit is contained in:
Daniel Carrillo 2025-01-12 16:12:32 +01:00
parent 43abb65b09
commit c23f469e05
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16
2 changed files with 4 additions and 2 deletions

View File

@ -85,6 +85,8 @@ listen_on unix:@mykitty
map F1 launch --allow-remote-control kitty +kitten broadcast map F1 launch --allow-remote-control kitty +kitten broadcast
map ctrl+alt+p kitten secrets.py "description" "Kitty password" 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>l kitten hints --type line --program @
map kitty_mod+p>w kitten hints --type word --program @
#: }}} #: }}}

View File

@ -19,7 +19,7 @@ from kitty.boss import Boss
def main(args: List[str]) -> Optional[str]: def main(args: List[str]) -> Optional[str]:
secrets = get_secret_names(args[1], args[2]) secrets = get_secret_names(args[1], args[2])
entries = WordCompleter(secrets) entries = WordCompleter(list(secrets.keys()))
session = PromptSession(completer=entries) session = PromptSession(completer=entries)
try: try:
entry = session.prompt('> ', pre_run=expand_prompt) entry = session.prompt('> ', pre_run=expand_prompt)
@ -54,7 +54,7 @@ def get_secret_names(attribute: str, value: str) -> Dict[str, str]:
return secrets 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) window = boss.window_id_map.get(target_window_id)
if window is not None: if window is not None:
window.paste(answer) window.paste(answer)