我正在尝试自定义我的 Ubuntu 在我的两台电脑上使用 i3-wm , 多边形和 zsh (带有 oh-my-zsh 在其上)
我在我的一台计算机上遇到了一些问题,我在另一台上没有,尽管以相同的方式进行并为它们使用相同的配置文件,以便在我的两台设备上拥有相同的工作区。
在 zsh 上,我使用的是 powerlevel10k/powerlevel10k
我安装在 oh-my-zsh 上的主题是为了有一个更漂亮的终端。
问题是,当我在 git 项目中时,shell 显示了漂亮的字体图标,例如分支图标,或显示时间旁边的时钟图标等。
这在我的第一台计算机上完美运行,但在第二台计算机上却没有。图标没有显示,所以我的终端不太吸引人。
我对 polybar 有同样的问题。某些图标在一台计算机上可以很好地呈现,而在另一台计算机上却没有呈现。有时,它们甚至会被奇怪的亚洲(我认为它来自亚洲语言,但我不确定)字符所取代。
我想知道为什么我在两台设备上都没有相同的结果以及如何在计算机 2 上修复它。
以下是所用版本的摘要:
Ubuntu = 18.04 LTS
i3-wm = 4.18
Polybar = 3.4.0
zsh = 5.4.2
oh-my-zsh = Version unknown
最佳答案
您需要安装有能力的字体并配置您的终端才能使用。由于您使用的是 powerlevel10k,因此最好使用 the font that powerlevel10k recommends .
Meslo Nerd Font patched for Powerlevel10k
Gorgeous monospace font designed by Jim Lyles for Bitstream, customized by the same for Apple, further customized by André Berg, and finally patched by yours truly with customized scripts originally developed by Ryan L McIntyre of Nerd Fonts. Contains all glyphs and symbols that Powerlevel10k may need. Battle-tested in dozens of different terminals on all major operating systems.
Automatic font installation
If you are using iTerm2 or Termux,
p10k configure
can install the recommended font for you. Simply answerYes
when asked whether to install Meslo Nerd Font.If you are using a different terminal, proceed with manual font installation. 👇
Manual font installation
Download these four ttf files:
Double-click on each file and click "Install". This will make
MesloLGS NF
font available to all applications on your system. Configure your terminal to use this font:
- iTerm2: Open iTerm2 → Preferences → Profiles → Text and set Font to
MesloLGS NF
. Alternatively, typep10k configure
and answerYes
when asked whether to install Meslo Nerd Font.- Apple Terminal Open Terminal → Preferences → Profiles → Text, click Change under Font and select
MesloLGS NF
family.- Hyper: Open Hyper → Edit → Preferences and change the value of
fontFamily
undermodule.exports.config
toMesloLGS NF
.- Visual Studio Code: Open File → Preferences → Settings, enter
terminal.integrated.fontFamily
in the search box and set the value toMesloLGS NF
.- GNOME Terminal (the default Ubuntu terminal): Open Terminal → Preferences and click on the selected profile under Profiles. Check Custom font under Text Appearance and select
MesloLGS NF Regular
.- Konsole: Open Settings → Edit Current Profile → Appearance, click Select Font and select
MesloLGS NF Regular
.- Tilix: Open Tilix → Preferences and click on the selected profile under Profiles. Check Custom font under Text Appearance and select
MesloLGS NF Regular
.- Windows Console Host (the old thing): Click the icon in the top left corner, then Properties → Font and set Font to
MesloLGS NF
.- Windows Terminal (the new thing): Open Settings (
Ctrl+,
), search forfontFace
and set value toMesloLGS NF
for every profile.- Termux: Type
p10k configure
and answerYes
when asked whether to install Meslo Nerd Font.IMPORTANT: Run
p10k configure
after changing terminal font. The old~/.p10k.zsh
may work incorrectly with the new font.
关于font-awesome - 为什么我的终端外壳上没有呈现或替换 Font Awesome 字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61160791/