diff --git a/plugins/msg/msg.ask.fish b/plugins/msg/msg.ask.fish new file mode 100644 index 0000000..e2006c7 --- /dev/null +++ b/plugins/msg/msg.ask.fish @@ -0,0 +1,12 @@ +# Print a message with msg and wait for y/n input. Return true on y\*. +# @params → msg.fish +function msg.ask + msg $argv + head -n 1 | read answer + switch $answer + case y\* Y\* + return 0 + case \* + return 1 + end +end diff --git a/plugins/msg/msg.fish b/plugins/msg/msg.fish new file mode 100644 index 0000000..835bc14 --- /dev/null +++ b/plugins/msg/msg.fish @@ -0,0 +1,523 @@ +# __ _ ___ ___ _ +# / ' \(_- | style][style] +# +# OPTIONS +# -s +# Do not separate arguments with spaces. +# -n +# Do not output a newline at the end of the message. +# +# STYLES +# _text_ Bold +# __text__ Underline +# ___text___ Bold and Underline +# `$variable` Apply @ to $variables +# /directory/ Directories +# [url] Links +# \n Line Break +# \t Tab Space +# +# @ fg=bg=RGB|RRGGBB|name|random +# RGB value can be any three to six hex digit or color name. +# e.g, @0fb, @tomato, @random, @error, @ok. +# +# AUTHORS +# @bucaran (Jorge Bucaran) +# +# v. 0.1.0 +#/ + +# Global `msg` default color and styles. +set --global msg_color_fg FFFFFF +set --global msg_color_bg normal +set --global msg_style_url 00FF00 $msg_color_bg -u +set --global msg_style_dir FFA500 $msg_color_bg -u +set --global msg_color_err FF0000 +set --global msg_color_ok 00FA9A + +# Set style, fg/bg colors and reset. Modifies its parent scope of `msg`. +# @params [] [] [