tags keys and other improvements

This commit is contained in:
2026-03-16 09:39:08 +01:00
parent 8a0c8bc2d7
commit 28aca1a82b
7 changed files with 232 additions and 84 deletions

24
src/sh/varia.sh Normal file
View File

@@ -0,0 +1,24 @@
# Various functions
# This prompts the user for a "yes" or a "no"
# @argument $1: Question
# @argument $2: Content to show in preview window
# @return: 0 if the user answered "yes" and 1 otherwise.
#!/bin/sh
ynprompt() {
return $(printf '0 \033[32myes\033[0m\n1 \033[31mno\033[0m\n' |
$FZF \
--sync \
--bind='start:pos(2)' \
--bind='ctrl-c,ctrl-g,ctrl-q,esc:pos(2)+accept' \
--reverse \
--no-input \
--header="$1" \
--preview-window='60%,border-line' \
--margin='5%,5%,5%,15%' \
--preview="echo \"$2\"" \
--with-nth=2 \
--accept-nth=1 \
--header-border='line' \
--color='border:yellow,header:yellow')
}