Skip to content

Instantly share code, notes, and snippets.

@ConnerWill
Last active May 18, 2022 03:03
Show Gist options
  • Save ConnerWill/9b551f54285b29e3f6b3e3a1a093496d to your computer and use it in GitHub Desktop.
Save ConnerWill/9b551f54285b29e3f6b3e3a1a093496d to your computer and use it in GitHub Desktop.
Pointless bash function to show an interesting figlet font with basic help menu. More of a test/example/template than anything :-) Requires figlet
### figlet-tr help
funcname="figlet-tr"
figlettrhelp="
TITLE:
$funcname [-h|--help] [string]
DESCRIPTION:
{{_Description_}} # Description
If no input messege is used, the ENVIROMENT VARIABLE 'USER' will be used instead.
INSTALLATION:
Add this line to your '.bashrc' or '.zshrc'\
source \"/PATH/TO/$funcname\"
USAGE:
% $funcname [string]
OPTIONS:
--help | -h : Show this help menu
EXAMPLES:
% $funcname 'string' (Using string input)
% $funcname (Using no input resulting is showing env '$USER')
$ $funcname -h (Show help)
"
function figlettr(){
if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]] && echo "$figlettrhelp" && return
[[ -z "$1" ]] && local mssssg="$USER" || local mssssg="$1"
echo "$mssssg"
echo "$mssssg" | figlet -t -f lean | tr ' _/' ' ()'
echo "$mssssg" | figlet -t -f lean | tr ' _/' '/ '
echo "$mssssg" | figlet -t -f lean | tr ' _/' ' //'
echo "$mssssg" | figlet -t -f lean | tr ' _/' './\\'
}
alias figlet-tr="figlettr"
@ConnerWill
Copy link
Author

Example Output

           $USER

              ()    ()    ()    ()()()  ()()()()  ()()()
           ()()()  ()    ()  ()        ()        ()    ()
          ()()    ()    ()    ()()    ()()()    ()()()
           ()()  ()    ()        ()  ()        ()    ()
        ()()()    ()()    ()()()    ()()()()  ()    ()
         ()

        ////////////////////////////////////////////////////
        //////  ////  ////  ////      //        //      ////
        ///      //  ////  //  ////////  ////////  ////  ///
        //    ////  ////  ////    ////      ////      //////
        ///    //  ////  ////////  //  ////////  ////  /////
              ////    ////      ////        //  ////  //////
        /  /////////////////////////////////////////////////
        ////////////////////////////////////////////////////

              //    //    //    //////  ////////  //////
           //////  //    //  //        //        //    //
          ////    //    //    ////    //////    //////
           ////  //    //        //  //        //    //
        //////    ////    //////    ////////  //    //
         //

        ....................................................
        ....../\..../\..../\..../\/\/\../\/\/\/\../\/\/\....
        .../\/\/\../\..../\../\......../\......../\..../\...
        ../\/\..../\..../\..../\/\..../\/\/\..../\/\/\......
        .../\/\../\..../\......../\../\......../\..../\.....
        /\/\/\..../\/\..../\/\/\..../\/\/\/\../\..../\......
        ./\.................................................
        ....................................................

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment