1

I've installed Arch about a week ago, and since then I been struggling with the powerline fonts. But after installing the pkg powerline-fonts, I configured the .zshrc file by adding these lines:

 powerline-daemon -q 
. /usr/share/powerline/bindings/zsh/powerline.zsh

The best I could do is commenting the line in the .zshrcfile that chooses a specific theme and letting the above code to run, and looks like this: powerline-fonts fix.

Still, the oh-my-zsh themes don't work; for example this is the agnoster theme: agnoster theme.

Another issue I have is that the symbols or the numbers are not shown properly in the terminal, any terminal, for example when using broot:br listing or bat: bat

I think these problems are linked and that's why I've asked the two questions in one. My question is: How could I fix this and have the oh-my-zsh themes work properly? On my vm they look like this:agnoster-theme and bat. I would like to make them look identical.

1 Answer 1

2

Good Ol' Locale

One issue I have had come up is not having my locale set, which causes all sorts of headache and misery to befall the unaware. To set it, go to /etc/locale.gen and uncomment the US English locale: en_US.UTF-8 UTF-8 then as root run locale-gen and as root again localectl set-locale LANG=en_US.UTF-8 just to be extra sure. Then reboot and if the issue persists check out this guide from Arch Wiki and see if the steps there work for you.


Alternative Installation Method

Additionally and to rule out another possible problem, you can try an alternative method of installing powerline, first you will need to download python-pip, then you will use it to download powerline.

sudo pacman -S git python
su -c 'pip install git+git://github.com/Lokaltog/powerline'

Now this new installation of powerline is in /usr/lib/python3.9/site-packages/powerline/ so add the following to .zshrc

if [[ -r /usr/lib/python3.9/site-packages/powerline/bindings/zsh/powerline.zsh ]]; then
  source /usr/lib/python3.9/site-packages/powerline/bindings/zsh/powerline.zsh
fi

and you may want to alternatively install the powerline fonts, to do so try the below:

 wget https://github.com/Lokaltog/powerline/raw/develop/font/PowerlineSymbols.otf https://github.com/Lokaltog/powerline/raw/develop/font/10-powerline-symbols.conf
 sudo mv PowerlineSymbols.otf /usr/share/fonts/
 sudo fc-cache -vf
 sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/

This is not an exhaustive list, there is simply a lot of different avenues to pursue with rectifying this one which I haven't had come up in a long time (I scripted out my installation from ISO then another one provisions my dotfiles and installs my programs to taste, which spares me these headaches generally but causes a bunch of its own) but I do hope it helps or leads you along the right path!

1
  • I was using Fedora, and I had my locale set to "en-CA" which is actually not supported... I had it working by looking at your answer, and used "en-US". Problem solved.
    – Haomin
    Commented Apr 13, 2023 at 18:20

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .