Awesome FOSS Logo
Discover awesome open source software
Launched 🚀🧑‍🚀

Powerline, Konsole, and Tmux

Categories

If you’re using Konsole, fonts are a little hard to get situated correctly. Often Konsole shows you only a small subset of the fonts that are available on your system, so I wanted to write a little about how to figure out the Konsole font mess (well not really a mess, but a little difficult).

So let’s start with powerline:

Powerline

Github

I found the easiest way to install powerline was just to download the source and build with setup.py. It was super painless, I don’t expect that many people will have a lot of problems at this step (don’t forget the –prefix option if you’re not root!).

You can even install with pip (which didn’t quite work as well for me)!

After you have powerline installled, you need to integrate it with the tools that you are planning to use, these instructions differ for tmux, vim and ipython shells.You can find these instructions on ReadTheDocs

Regular console & Tmux

Getting powerline working with the console is a pretty straightforward affair, all you do is insert a line into your .bashrc (~/.bashrc) file like so:

. <path to powerline build folder from github>/powerline/bindings/bash/powerline.sh

Such easy!

Getting powerline working with tmux should also be pretty easy. As is written in the docs, you essentially need a line like this in your tmux.conf (~/.tmux.conf):

source '<path to powerline build folder from github>/powerline/bindings/tmux/powerline.conf'

wow!

So here’s where I hit a snag — Konsole.

So as you should know by now, powerline utilizes some special characters to give you the pretty terminal we crave. Font patching, as of this posting, does not QUITE work out so well (a lot of the symbols are slightly misalingned, which isn’t a huge issue, but I can’t stand it, especially when I know it’s intended to work well). The easiest and most painless way around this is to just download the pre-patched (and fiddled with) supported fonts from the powerline-fonts repo on github. After downloading the fonts, there are a few locations that you can put them.

(note, you shoudl ensure that you have fontconfig and fc-cache installed before this)

/usr/share/fonts/truetype/<whatever font you’re trying to augment>

~/.fonts/

After copying the fonts, you should use fc-cache to update the font cache with the command below:

fc-cache -vf

HOWEVER, there is an issue with Konsole — it does not tend to see the new fonts, DESPITE the call to fc-cache!

So after a little bit of digging on the good ‘ol ‘net, I found that the trick was to use dpkg to reconfigure fontconfig! A little obtuse but the fix is as follows:

``If you’re using Konsole, fonts are a little hard to get situated correctly. Often Konsole shows you only a small subset of the fonts that are available on your system, so I wanted to write a little about how to figure out the Konsole font mess (well not really a mess, but a little difficult).

So let’s start with powerline:

Powerline

Github

I found the easiest way to install powerline was just to download the source and build with setup.py. It was super painless, I don’t expect that many people will have a lot of problems at this step (don’t forget the –prefix option if you’re not root!).

You can even install with pip (which didn’t quite work as well for me)!

After you have powerline installled, you need to integrate it with the tools that you are planning to use, these instructions differ for tmux, vim and ipython shells.You can find these instructions on ReadTheDocs

Regular console & Tmux

Getting powerline working with the console is a pretty straightforward affair, all you do is insert a line into your .bashrc (~/.bashrc) file like so:

. <path to powerline build folder from github>/powerline/bindings/bash/powerline.sh

Such easy!

Getting powerline working with tmux should also be pretty easy. As is written in the docs, you essentially need a line like this in your tmux.conf (~/.tmux.conf):

source '<path to powerline build folder from github>/powerline/bindings/tmux/powerline.conf'

wow!

So here’s where I hit a snag — Konsole.

So as you should know by now, powerline utilizes some special characters to give you the pretty terminal we crave. Font patching, as of this posting, does not QUITE work out so well (a lot of the symbols are slightly misalingned, which isn’t a huge issue, but I can’t stand it, especially when I know it’s intended to work well). The easiest and most painless way around this is to just download the pre-patched (and fiddled with) supported fonts from the powerline-fonts repo on github. After downloading the fonts, there are a few locations that you can put them.

(note, you shoudl ensure that you have fontconfig and fc-cache installed before this)

/usr/share/fonts/truetype/<whatever font you’re trying to augment>

~/.fonts/

After copying the fonts, you should use fc-cache to update the font cache with the command below:

fc-cache -vf

HOWEVER, there is an issue with Konsole — it does not tend to see the new fonts, DESPITE the call to fc-cache!

So after a little bit of digging on the good ‘ol ‘net, I found that the trick was to use dpkg to reconfigure fontconfig! A little obtuse but the fix is as follows:

``

The output seems to suggest it’s doing the same thing as fc-cache, but for some reason, Konsole shows the fonts only after I do this.

And now konsole looks perfect! Happy hacking