Theme.sh 一个交互式终端主题选择脚本(400+ 主题)

theme.sh是一个可以轻松更改终端主题的脚本。它带有 400 多个主题、一个可选的交互式主题选择器,并且与终端无关。

该脚本可作为包含所有400 多个主题的文件。它可以直接设置终端主题,或者,如果您的系统上安装了fzf,它会在预览窗格中提供用于交互式主题选择的终端菜单,或者如果您使用的终端支持 TRUECOLOR,则直接作为您的终端主题。您还可以过滤明暗主题

要使用 theme.sh,您需要使用任何支持 OSC 4/11 的终端。这包括 kitty, st, Terminal.app, iTerm2, alacritty, urxvt,以及任何基于 libvte 的终端,如 GNOME Terminal,Terminator,Guake,Xfce Terminal,Mate Terminal,Konsole 等。目前看起来 Windows Terminal 还不支持这个。

theme.sh 也可以很容易地在脚本中使用,其开发人员提供了 SSH 集成示例(在当前 ssh 命令的持续时间内应用主题)。

其他功能包括使用主题历史记录~/.theme_history默认情况下存储在其中),以及将 kitty 主题添加到脚本的能力

安装主题.sh

要下载theme.sh脚本并将其安装到/usr/local/bin,请使用:

linuxmi@linuxmi:~/www.linuxmi.com$ wget https://raw.githubusercontent.com/lemnos/theme.sh/master/bin/theme.sh -O /tmp/theme.sh

linuxmi@linuxmi:~/www.linuxmi.com$ sudo install /tmp/theme.sh /usr/local/bin

无需任何其他配置,使用theme.sh 设置的主题仅用于当前终端。重新启动时(或者如果您打开一个新窗口),它会使用以前的终端主题。要将最后选择的主题应用于所有新支持的终端,您需要编辑您的 shell 配置文件:

  • 对于 Bash 和 Zsh,在~/.bashrc~/.zshrc末尾添加以下代码(取决于您使用的是什么):
if command -v theme.sh > /dev/null; then
    [ -e ~/.theme_history ] && theme.sh "$(theme.sh -l|tail -n1)"
fi

  • 对于 Fish,在~/.config/fish/config.fish文件末尾添加以下代码
if type -q theme.sh
    if test -e ~/.theme_history
        theme.sh (theme.sh -l|tail -n1)
    end
end

有关更多选项、脚本示例等,请参阅theme.sh GitHub 页面

The post Theme.sh 一个交互式终端主题选择脚本(400+ 主题) first appeared on Linux迷.

版权声明:
作者:主机优惠
链接:https://www.techfm.club/p/10732.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>