gnome-terminal theme

base16 gnome terminal

选择一个,运行相应的 .sh

下面是 Old Way,不再推荐

Solarized Colorscheme for Gnome Terminal

1
2
3
git clone https://github.com/Anthony25/gnome-terminal-colors-solarized.git
cd gnome-terminal-colors-solarized
./install.sh

按提示选择 darklight 主题。为了使 ls 命令显示色彩与之相配,中间会提示是否下载 dircolors(由于伟大的墙的问题,有可能下载不成功),手动安装方式如下:

1
2
3
4
5
6
7
8
wget --no-check-certificate https://raw.github.com/seebi/dircolors-solarized/master/dircolors.ansi-dark
mv dircolors.ansi-dark .dircolors
eval `dircolors ~/.dircolors`

# or light
wget --no-check-certificate https://raw.github.com/seebi/dircolors-solarized/master/dircolors.ansi-light
mv dircolors.ansi-light .dircolors
eval `dircolors ~/.dircolors`

zsh

1
2
sudo apt install zsh
chsh -s /usr/bin/zsh

oh-my-zsh

1
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

omz powerlevel9k theme

安装

1
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

配置 ~/.zshrc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
ZSH_THEME="powerlevel9k/powerlevel9k"

POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()

POWERLEVEL9K_VIRTUALENV_BACKGROUND=107
POWERLEVEL9K_VIRTUALENV_FOREGROUND='white'
POWERLEVEL9K_CUSTOM_NOW_PLAYING_BACKGROUND='blue'
POWERLEVEL9K_CUSTOM_NOW_PLAYING_FOREGROUND='black'
POWERLEVEL9K_OS_ICON_BACKGROUND='white'
POWERLEVEL9K_OS_ICON_FOREGROUND='black'
POWERLEVEL9K_TIME_BACKGROUND='white'
POWERLEVEL9K_TIME_FOREGROUND='black'

powerline 与 awesome 字体

显示 git 分支等一些特殊 awesome glyph 字符

直接使用 nerdfonts,在 gnome-terminal -> Edit -> Preferences 里选 Custom font,设置想要的字体

下面是 Old Way,不再推荐

1
sudo apt install fonts-powerline

如果有问题的话,手动安装打好补丁的字体 powerline font

1
2
3
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh

然后在 gnome-terminal -> Edit -> Preferences 里选 Custom font,设置想要的字体,我这里选择 Source Code Pro for Powerline Medium

为了配合上面的 powerlevel9k 显示出一些更 awesome 的字符,需要 awesome-terminal-fonts

1
2
3
4
5
git clone https://github.com/gabrielelana/awesome-terminal-fonts.git --depth=1
cd awesome-terminal-fonts
cp build/* ~/.local/share/fonts/
fc-cache -fv
cp config/10-symbols.conf ~/.config/fontconfig/conf.d/

修改 .zshrc 添加一行 source $HOME/.local/share/fonts/*.sh

修改 ~/.config/fontconfig/conf.d/10-symbols.conf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12

<fontconfig>
  <alias>
    <family>Source Code Pro for Powerline</family>
    <prefer>
      <family>Pomodoro</family>
      <family>FontAwesome</family>
      <family>Octicons</family>
      <family>Icomoon</family>
    </prefer>
  </alias>
</fontconfig>

最终效果

awesome-terminal