urxvt powerline symbols

7,395

Answering my own question: in gentoo you have to build urxvt with unicode3 and vanila USE flags, and without alt-font-width flag

Update 17 Feb 17:
Since the original question i have switched my laptop and did the configuration on a modern gentoo from scratch. Here is what it took me to have the powerline characters i need (not all of them) and national characters together with Inconsolata in urxvt.

I am not saying that this is the right way to do that. This topic is very debatable, because most terminal emulators implement hacks to make these work out of the box, but urxvt does not, stating that it is the fonts that are the problem, not the emulator. Gentoo adds patches to urxvt to "support" these characters, basically adding the hack that urxvt authors find bad. So eventually there is more then one way to do that.

In a vanilla gentoo you will need the following use flags for urxvt: (please use your common sense to filter flags that are not related to fonts and do not blindly copy mine)

[I] x11-terms/rxvt-unicode
     Available versions:  9.21^t ~9.22^t **9999^t {256-color alt-font-width blink buffer-on-clear fading-colors +focused-urgency +font-styles iso14755 +mousewheel +perl pixbuf secondary-wheel startup-notification unicode3 +vanilla wcwidth xft}

I used the original powerline instructions here: http://powerline.readthedocs.io/en/master/installation/linux.html#fonts-installation (the "fontconfig" method). (There is a powerline ebuild in portage, but it does nothing for me)

But that only gave me like half of the symbols, so I also downloaded a patched font (i used sauce code) as a last resort. My font config in .Xresourses look like that:

URxvt*font:  xft:inconsolata:size=10:antialias=true,xft:DejaVu Sans:size=10:antialias=true,xft:Sauce Code Powerline:antialias=true:hinting=true:size=9

DejaVu Sans is for cyrillic letters, if you don't need them you can wave it out. This gives me all the symbols (patched inconsolata gives bad results).

Share:
7,395

Related videos on Youtube

Scott Tiger
Author by

Scott Tiger

Updated on September 18, 2022

Comments

  • Scott Tiger
    Scott Tiger almost 2 years

    I use urxvt.

    So i was playing with oh-my-zsh themes and found out that some of them have "The PowerLine Symbols".

    (if you do not know what it is - take a look. https://gist.githubusercontent.com/agnoster/3712874/raw/screenshot.png )

    So basically you have a set of patches to fonts, which add these extra characters. Or fonts can be downloaded, put info ~/.fonts && fc-cache -vf ~/.fonts && voila!.

    If you do not have a fully powerline-awair font, you can chain fonts like that: URxvt*font: xft:Terminus:pixelsize=14:antialias=true,xft:Inconsolata\ for\ Powerline:pixelsize=14:antialias=true

    In this case you use regular Mr.Terminus, and when it lacks characters, i guess, it goes to Ms.Inconsolata.

    So, my problem looks like this: http://5cm.ru/code/i6/PUno.png

    I have tried so far:

    URxvt*font: xft:Terminess Powerline:pixelsize=15:antialias=true
    URxvt*font: xft:Fantasque Sans Mono:style=Regular:antialias=true
    URxvt*font: xft:Menlo:pixelsize=16:antialias=true
    URxvt*font: xft:Terminus:pixelsize=14:antialias=true,xft:Inconsolata\ for\ Powerline:pixelsize=14:antialias=true
    URxvt*font: xft:PowerlineSymbols:pixelsize=14:antialias=true,xft:Terminus:pixelsize=14:antialias=true
    URxvt*font: xft:Terminus:pixelsize=14:antialias=true,xft:PowerlineSymbols:pixelsize=14:antialias=true
    

    The screenshot is of URxvt*font: xft:Terminess Powerline:pixelsize=15:antialias=true

    My urxvt is definitely built with unicode support. I run gentoo and double checked the useflags - unicode3 -vanilla.

    The fonts are downloaded to ~/.fonts. Here is a sample output:

        fc-list| grep Power
        /home/rakul/.fonts/ter-powerline-x12n.bdf: Terminess Powerline:style=Regular
        /home/rakul/.fonts/ter-powerline-x14n.pcf: Terminess Powerline:style=Regular
        /home/rakul/.fonts/ter-powerline-x12n.pcf: Terminess Powerline:style=Regular
        /home/rakul/.fonts/ter-powerline-x14b.pcf: Terminess Powerline:style=Bold
        /home/rakul/.fonts/ter-powerline-x12b.pcf: Terminess Powerline:style=Bold
        /home/rakul/.fonts/ter-powerline-x14b.bdf: Terminess Powerline:style=Bold
        /home/rakul/.fonts/ter-powerline-x12b.bdf: Terminess Powerline:style=Bold
        /usr/share/fonts/powerline-symbols/PowerlineSymbols.otf: PowerlineSymbols:style=Medium
        /home/rakul/.fonts/Inconsolata for Powerline.otf: Inconsolata for Powerline:style=Medium
    /home/rakul/.fonts/ter-powerline-x14n.bdf: Terminess Powerline:style=Regular
    

    Help appreciated!

    Update 1: i forgot to mention one thing - the font actualy do work outside urxvt: konsole + urxvt: hxxp://img.5cm.ru/view/i6/Kqzo.png so the question is - what can be done to urxvt?

    Here are my USE flags:

     equery u rxvt-unicode 
    [ Legend : U - final flag setting for installation]
    [        : I - package is installed with flag     ]
    [ Colors : set, unset                             ]
     * Found these USE flags for x11-terms/rxvt-unicode-9999:
     U I
     + + 256-color            : Enable 256 color support
     - + alt-font-width       : Calculate the font width using a different method
     - - blink                : Enable blinking text
     - - buffer-on-clear      : Store visible output to history buffer when clearing the screen with ctrl-l. Read https://bbs.archlinux.org/viewtopic.php?id=129302
     - - fading-colors        : Enable colors fading when off focus
     + + focused-urgency      : Enable the urgent flag when a terminal window is focused
     + + font-styles          : Enable support for bold and italic fonts
     - - iso14755             : Enable ISO-14755 support
     + + mousewheel           : Enable scrolling via mouse wheel or buttons 4 and 5
     + + perl                 : Enable perl script support. You can still disable this at runtime with -pe ""
     - - pixbuf               : Enable transparency support using gtk's pixbuf
     - - secondary-wheel      : Support for wheel scrolling on secondary screens (like mutt). Read http://lists.schmorp.de/pipermail/rxvt-unicode/2011q4/001491.html
     + + startup-notification : Enable application startup event feedback mechanism
     + + unicode3             : Use 21 instead of 16 bits to represent unicode characters
     - - vanilla              : Do not add extra patches which change default behaviour; DO NOT USE THIS ON A GLOBAL SCALE as the severity of the meaning changes drastically
     - + wcwidth              : Enable wide char width support
     + + xft                  : Build with support for XFT font renderer (x11-libs/libXft)
    

    Update 2: I managed to make another symbol appear :) i read, that the "modern" way of adding Powerline characters support is by adding the PowerlineSymbols.otf file to ~/.fonts and ~/.config/fontconfig/conf.d/10-powerline-symbols.conf

    This way i not have this: hxxp://img.5cm.ru/view/i6/2TBR.png see, now there are 4 out of 7.

  • nert
    nert over 7 years
    Could you list all the use flags? When I try it with unicode3 and vanilla and xft, it doesn't work. I still get a square instead of powerline symbols.
  • Scott Tiger
    Scott Tiger over 7 years
    sure, no problem. i will update my original answer to reflect modern changes.