aboutsummaryrefslogtreecommitdiff
path: root/conf.d/00functions.fish
diff options
context:
space:
mode:
authorDeposite Pirate2025-10-16 19:30:01 +0200
committerDeposite Pirate2025-10-16 19:30:01 +0200
commit517acf6ac9a9da29ac4cd52de2a52db5a8fab88a (patch)
tree29c29eb348c0c77cc6588dd84f7054d53bc49d70 /conf.d/00functions.fish
parent1dfd92bdd350ff109d2cf2152e6a7d59f24f672f (diff)
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
Diffstat (limited to 'conf.d/00functions.fish')
-rw-r--r--conf.d/00functions.fish10
1 files changed, 10 insertions, 0 deletions
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