From 517acf6ac9a9da29ac4cd52de2a52db5a8fab88a Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Thu, 16 Oct 2025 19:30:01 +0200 Subject: Integrate utility functions Add the ask function that just prompts for yes or no. Clean up and make available the copy/paste/notify aliases to all scripts. modified: conf.d/00functions.fish modified: conf.d/05gui.fish modified: functions/alert.fish --- conf.d/00functions.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'conf.d/00functions.fish') diff --git a/conf.d/00functions.fish b/conf.d/00functions.fish index f390b29..d1ad87b 100644 --- a/conf.d/00functions.fish +++ b/conf.d/00functions.fish @@ -34,3 +34,13 @@ function find_prog --description "Find one or more programs in \$PATH" end end end + +function ask --description "Ask a question answered by yes or no" + read -n 1 -f -P (set_color -o blue)"::"(set_color normal)" $argv[1] [y/N] " answer + switch $answer + case y Y + return 0 # yes + case '*' + return 1 # no + end +end -- cgit v1.3.1