Powerlevel9k: All my icons work except the python icon with virtualenv

Created on 12 Nov 2016  ·  11Comments  ·  Source: Powerlevel9k/powerlevel9k

I am using Source Code Pro for Powerline. I am attaching a screenshot.
py-logo

question

Most helpful comment

Sorry, my bad.

I had POWERLEVEL9K_MODE incorrectly set to awesome-fontconfig while using Nerd fonts... (tips to others: it should be nerdfont-complete or nerd-fontconfig).

All 11 comments

Well. It seems like your font does not have the python icon on that codepoint (or maybe not at all). Which strategy of awesome terminal fonts do you use?

Btw. You could easily change the icon by setting POWERLEVEL9K_PYTHON_ICON to whatever icon you have in your font. ;)

I am using patching strategy because I was sure I was going to use only one font Source Code Pro. Also I know I can change the icon, I wanted to know if anyone else faced the same issue and how they resolved it.

Interesting. The python icon is the "snake" emoji.
So echo $'\U1F40D' shows the wrong symbol on your machine, right?

Maybe you need an additional font package to display them (e.g. on ubuntu linux). In OSX it should work out of the box.

@dritter It did work. Thanks. But I am kind of unsatisfied. I have seen emojis look prettier on my friends Mac.

Well, if you find a prettier icon, you can overwrite the default one ;)

Is there any way I can use nerd fonts with the current scenario?

Yes, but it takes a little effort. You'll have to overwrite every icon by setting the right environment variables. You can get a full list of icons with get_icon_names.

The reason why we do not have a mapping for nerd font is because they change the codepoints depending on the combination of merged fonts. So we cannot give a list of icons for every combination.

Thanks @dritter but I guess I will stick to what I have since it will require some work.

There seems to be a bug.

By default POWERLEVEL9K_PYTHON_ICON:  (\ue63c, which seems to be a Chinese character).
I say it's a bug, because I don't see a reason why the Python icon should be a Chinese character, even if there are fonts that support it.

It should be \U1F40D (snake) or \UE73C (python logo) instead.

The problem is in functions/icons.zsh.

In addition, on a dark terminal, black font dark blue is hard to read, so I changed it to black on cyan.

To workaroud the bug, I have this in my .zshrc, after including powerlevel9k (to be able to override the function):

# POWERLEVEL9K_PYTHON_ICON='\U1F40D ' # 🐍
POWERLEVEL9K_PYTHON_ICON='\UE73C '  # 

prompt_virtualenv() {              
 local virtualenv_path="$VIRTUAL_ENV"
 if [[ -n "$virtualenv_path" && "$VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then
 "$1_prompt_segment" "$0" "$2" "cyan" "black" "$(basename "$virtualenv_path")" 'PYTHON_ICON'
 fi
}

@cvmocanu \ue63c is the setting for flat, awesome-fontconfig and awesome-patched, if you use nerdfont-complete or nerdfont-fontconfig as your POWERLEVEL9K_MODE you will get \ue73c as python icon.
In case of POWERLEVEL9K_MODE=awesome-mapped-fontconfig you'll get the snake (\u1f40d) as Python icon by default

Sorry, my bad.

I had POWERLEVEL9K_MODE incorrectly set to awesome-fontconfig while using Nerd fonts... (tips to others: it should be nerdfont-complete or nerd-fontconfig).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielChabrowski picture DanielChabrowski  ·  3Comments

guidoilbaldo picture guidoilbaldo  ·  5Comments

shibumi picture shibumi  ·  3Comments

controversial picture controversial  ·  4Comments

OATOMO picture OATOMO  ·  4Comments