/ CLI

Patched Powerline fonts via urxvt

I'm a huge fan of the patched Powerline fonts. Those extra icons add a ton of useful information.

$ cd
$ git clone https://github.com/powerline/fonts.git
$ cd fonts
$ ./install.sh
$ cd ..
$ rm -rf ./fonts

I've also recently switched to urxvt as I figure out i3 and the X server.

$ sudo dnf install rxvt-unicode

However, I quickly noticed the patched fonts aren't recognized by the repo rxvt-unicode.

$ urxvt -fn 'xft:Droid Sans Mono for Powerline'
$ echo -e '\xEE\x82\xB0'

missing-icon

I tried almost all of the fonts without finding a complete set. The Fedora official package doesn't seem to be compiled with at least one necessary option for the Powerline stuff. Rebuilding it wasn't how I planned to spend my Saturday, but it's certainly how I spent it.

rxvt-unicode itself seems to come from this master. You could start from there, but a couple of things are immediately blocking:

$ git clone https://github.com/exg/rxvt-unicode
$ cd rxvt-unicode
$ git submodule add https://github.com/enki/libev
$ git submodule add https://github.com/yusiwen/libptytty

The system dependencies are much more opaque. It took me forever to discover an implicit redhat-rpm-config connection; I had all but given up on actually duplicating the success I stumbled on earlier today.

$ sudo dnf install git gcc gcc-c++ perl automake redhat-rpm-config perl-ExtUtils-ParseXS

These X packages are necessary as well:

$ sudo dnf install libX11 libX11-devel libXft libXft-devel

I ran into a Fedora issue right after that. xsubpp is installed to /usr/share/perl5/vendor_perl/ExtUtils/xsubpp, not the desired /usr/share/perl5/ExtUtils/xsubpp. It sounds like there's not a consensus on where that file belongs, so you'll have to massage it. There are two good solutions:

$ ln -s /usr/share/perl5/vendor_perl/ExtUtils/xsubpp /usr/share/perl5/ExtUtils/xsubpp
or
$ sed -i 's/\/ExtUtils\/xsubpp/vendor_perl\/ExtUtils\/xsubpp/g' src/Makefile.in

I also had trouble with the compiler. I had to add some additional flags to get things to work properly.

$ sed -i 's/CPPFLAGS = @CPPFLAGS@/CPPFLAGS = @CPPFLAGS@ -fPIC/' src/Makefile.in

After that, I was able to successfully run everything.

$ ./autogen.sh
$ ./configure --prefix=/usr --enable-everything
or maybe just the things you need
$ make
$ sudo dnf remove rxvt-unicode
$ sudo make install

Which yielded the icons I was hoping for.

$ urxvt -fn 'xft:Droid Sans Mono for Powerline'
$ echo -e '\xEE\x82\xB0'

icon-present

To make things easier, I've forked the repo with my changes. You can snag it and improve it if you'd like. Don't forget to clonely --recursively to get the submodules!

$ cd
$ git clone https://github.com/thecjharries/rxvt-unicode.git --recursive
$ cd rxvt-unicode
$ ./autogen.sh
$ ./configure --prefix=/usr --enable-everything && make
$ sudo make install

CJ Harries

I did a thing once. Change "blog." to "cj@" and you've got my email. All these opinions are mine and might not be shared by clients or employers.

Read More