I haven’t been using Ubuntu for a while, but I wanted to give it another try. I’m using my Ansible playbook for installing ZSH, Oh My Zsh, and p10k (Powerlevel10k), so I thought everything would work like a charm.
However, after running the playbook and restarting, the terminal did not look quite right:
You see the OS logo before the “>” is not displayed, and other icon fonts (I’m using exa/eza instead of “ls”) are missing, too (e.g., the one for YAML and Markdown files). In Arch, I knew how to solve icon problems for exa. Here in Ubuntu, I never experimented in that respect.
However, the p10k GitHub repository provides many hints in that respect. Unfortunately, Ubuntu does not provide packages for Nerd fonts. However, the p10k GitHub repository provides some Meslo fonts that can be directly downloaded.
The commands to solve the problem (provided you already have “fontconfig” and “wget” installed, otherwise, do install them) are:
1 2 3 4 |
sudo wget -P /usr/local/share/fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf sudo wget -P /usr/local/share/fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf sudo wget -P /usr/local/share/fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf sudo wget -P /usr/local/share/fonts https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf |
And then issue
1 |
fc-cache -fv |
You can verify that they are now installed:
1 2 3 4 5 |
fc-list | grep Meslo /usr/local/share/fonts/MesloLGS NF Bold.ttf: MesloLGS NF:style=Bold /usr/local/share/fonts/MesloLGS NF Bold Italic.ttf: MesloLGS NF:style=Bold Italic /usr/local/share/fonts/MesloLGS NF Regular.ttf: MesloLGS NF:style=Regular /usr/local/share/fonts/MesloLGS NF Italic.ttf: MesloLGS NF:style=Italic |
Now, reboot (this seems to be required), and the next time you open the terminal, everything looks fine (note the OS icon and the icons for YAML and Markdown files):
Of course, you could also download another Nerd font from the corresponding GitHub repository, but this procedure seems to work like a charm, and you use the p10k recommended font (Meslo).
By the way, the Gnome Text Editor automatically uses the new icon fonts. Other programs like Kate (which I use in Gnome as well) have to be configured to use the Meslo font.
Pingback: Oh My Zsh and Powerlevel10k in macOS | Lorenzo Bettini