theme.sh 是一个 Linux 终端的主题项目。内含超过 400 个预编译的主题。
https://github.com/lemnos/theme.sh
特征:
400多个预编译主题
终端不可知论(在任何终端上有OSC 4/11支持的作品(例如ST,Kitty,iterm))
保持历史
脚本友好
便携式(包含所有400个主题的单个<130k文件)
黑暗/光线过滤器,因此您可以决定何时要燃烧视网膜。
互动(需要FZF)
自我修改(可以摄取小猫咪主题)。
小型,独立且符合POSIX
案例:
理由:
您可以轻松地在开放式终端内切换主题。
您可以将shell的init文件作为唯一的真相来源。
您可以为所有boxen配置不同的主题(请参阅脚本)。
您可以配置st而无需重新编译:P。
安装:
只要把 theme.sh 放在你的路径上。
Linux
1 |
sudo curl -Lo /usr/bin/theme.sh 'https://ghproxy.com/https://raw.githubusercontent.com/lemnos/theme.sh/master/bin/theme.sh' && sudo chmod +x /usr/bin/theme.sh |
1 |
sudo curl -Lo /usr/bin/theme.sh 'https://ghproxy.com/https://raw.githubusercontent.com/lemnos/theme.sh/master/bin/theme.sh' && sudo chmod +x /usr/bin/theme.sh |
MacOS
1 |
sudo curl -Lo /usr/local/bin/theme.sh 'https://ghproxy.com/https://raw.githubusercontent.com/lemnos/theme.sh/master/bin/theme.sh' && sudo chmod +x /usr/local/bin/theme.sh |
示例:
有关选项的完整列表,请参见 them.sh -h。
1 2 3 4 5 6 7 8 |
> theme.sh --dark --list zenburn gruvbox solarized-dark ... > theme.sh zenburn |
1 |
> theme.sh -i #Interactive theme selection (requires fzf) |
一旦你找到了你喜欢的主题
1 |
theme.sh <theme> |
配置:
建议使用 ~/.bashrc
要自动加载最近选择的主题,您可以将内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
if command -v theme.sh > /dev/null; then [ -e ~/.theme_history ] && theme.sh "$(theme.sh -l|tail -n1)" # Optional #Binds C-o to the previously active theme. bind -x '"\C-o":"theme.sh $(theme.sh -l|tail -n2|head -n1)"' alias th='theme.sh -i' # Interactively load a light theme alias thl='theme.sh --light -i' # Interactively load a dark theme alias thd='theme.sh --dark -i' fi |
添加到 ~/.bashrc
~/.zshrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
if command -v theme.sh > /dev/null; then [ -e ~/.theme_history ] && theme.sh "$(theme.sh -l|tail -n1)" # Optional # Bind C-o to the last theme. last_theme() { theme.sh "$(theme.sh -l|tail -n2|head -n1)" } zle -N last_theme bindkey '^O' last_theme alias th='theme.sh -i' # Interactively load a light theme alias thl='theme.sh --light -i' # Interactively load a dark theme alias thd='theme.sh --dark -i' fi |
建议使用 ~/.vimrc
1 2 3 |
colorscheme default set notermguicolors highlight Search ctermfg=0 |
以上内容使vim与股票终端主题配合得很好。
转载请注明:站长资源站 » theme.sh 自定义 Linux 终端的主题