人们如何在 bash 脚本运行时显示精美的标题

问题描述 投票:0回答:5

如何让 bash 脚本有一个很酷的标题

目前我只是使用 echo 为我的脚本指定名称 arg clicker

而不是只有一条镗线 我如何制作 fnacy bash 脚本徽标

像下面这样:

just like the logo at tope of this shell

bash title
5个回答
3
投票

查看

tput
命令。
tput
用于改变终端特性。

例如

tput bold
tput setaf 3
tput setab 4
tput reset

3
投票

我更喜欢 3 个工具:

  • figlet
    - 制作精美的大字母(如屏幕截图所示)
  • lolcat
    - 制作丰富多彩的动画标题
  • boxes
    - 为您的标题制作精美的边框

用途:

   figlet "Your fancy title" | lolcat -a -s 100 
   figlet "Your fancy title" | lolcat -a -s 100 | boxes -d nuke

来自

boxes
官方网站的示例:


1
投票

有一些网站可以做到这一点。 看看这个网站: http://www.kammerl.de/ascii/AsciiSignature.php


1
投票

尝试安装“boxes” - 从手册页:

描述 Boxes 是一个文本过滤器,可以绘制任何类型的框 围绕其输入文本。盒子设计选择范围从简单的盒子到 复杂的 ASCII 艺术。盒子也可以被拆除和修复,即使它 因编辑内部文本而严重损坏。由于盒子可能 任何一侧都是开放的,盒子也可以用来创建区域 任何编程语言的注释。各种新的盒子设计 可以通过附加到自由格式轻松添加和共享 配置文件。盒子最初是为了与 vim(1) 文本编辑器,但它可以绑定到任何文本编辑器 支持过滤器,以及从命令行调用 独立工具。

$ boxes -h
boxes - draws any kind of box around your text (and removes it)
        (c) Thomas Jensen <[email protected]>
        Web page: http://boxes.thomasjensen.com/
Usage:  boxes [options] [infile [outfile]]
        -a fmt   alignment/positioning of text inside box [default: hlvt]
        -c str   use single shape box design where str is the W shape
        -d name  box design [default: first one in file]
        -f file  configuration file
        -h       print usage information
        -i mode  indentation mode [default: box]
        -k bool  leading/trailing blank line retention on removal
        -l       list available box designs w/ samples
        -m       mend box, i.e. remove it and redraw it afterwards
        -p fmt   padding [default: none]
        -r       remove box
        -s wxh   box size (width w and/or height h)
        -t str   tab stop distance and expansion [default: 8e]
        -v       print version information

:)
戴尔


0
投票

toilet
也值得注意,它是
figlet
的实现,并且工作原理类似。

© www.soinside.com 2019 - 2024. All rights reserved.