tags keys and other improvements
This commit is contained in:
24
src/sh/varia.sh
Normal file
24
src/sh/varia.sh
Normal 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')
|
||||
}
|
||||
Reference in New Issue
Block a user