Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

All my icons work except the python icon with virtualenv #338

Closed
rmad17 opened this issue Nov 12, 2016 · 11 comments
Closed

All my icons work except the python icon with virtualenv #338

rmad17 opened this issue Nov 12, 2016 · 11 comments
Labels

Comments

@rmad17
Copy link
Contributor

rmad17 commented Nov 12, 2016

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

@dritter
Copy link
Member

dritter commented Nov 13, 2016

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. ;)

@rmad17
Copy link
Contributor Author

rmad17 commented Nov 13, 2016

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.

@dritter
Copy link
Member

dritter commented Nov 13, 2016

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.

@rmad17
Copy link
Contributor Author

rmad17 commented Nov 13, 2016

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

@rmad17 rmad17 closed this as completed Nov 13, 2016
@dritter
Copy link
Member

dritter commented Nov 13, 2016

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

@rmad17
Copy link
Contributor Author

rmad17 commented Nov 13, 2016

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

@dritter
Copy link
Member

dritter commented Nov 13, 2016

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.

@rmad17
Copy link
Contributor Author

rmad17 commented Nov 14, 2016

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

@cvmocanu
Copy link

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
}

@iilonmasc
Copy link
Member

@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

@cvmocanu
Copy link

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants