romkatv / powerlevel10k

A Zsh theme
MIT License
44.43k stars 2.12k forks source link

Change OS_ICON #515

Closed Tanish2002 closed 4 years ago

Tanish2002 commented 4 years ago

Might be a dumb question but I can't seem to figure out how can I change the os icon...in Prompt

romkatv commented 4 years ago

What icon do you see and what do you want to change it to?

Tanish2002 commented 4 years ago

I see Manjaro's logo and I want to change it to Arch's logo or maybe Kali if possible..

romkatv commented 4 years ago

If you want to always see Archlinux logo regardless of your real OS, open ~/.p10k.zsh, search for POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION and sets its value to $'\uF303'. Put %B before it if you want a bold icon. Add a space after it if it looks too tight in your prompt.

If you want to see the icon of your real OS except when you are using Manjaro, define POWERLEVEL9K_LINUX_MANJARO_ICON=$'\uF303' in the same file.

If you want to add extra icons to your prompt, define a custom segment:

function prompt_my_extra_icon() {
  p10k segment -b yellow -f red -i $'\uF303'
}

Then add my_extra_icon to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. Type p10k help segment for help or search for prompt_example in ~/.p10k.zsh.

Tanish2002 commented 4 years ago

I tried this for the arch logo typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='$'\uF303'' even tried this for a penguin logo typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='$'\uF17C'' Both don't seem to work

With Custom Logo : Here Without Custom Logo : Here

Details: Terminal : st Multiplier : Tmux

Both the logo appear using echo '\uF17c' echo '\uF303'

romkatv commented 4 years ago

This is the right syntax:

typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION=$'\uF303'
Tanish2002 commented 4 years ago

Thanks A lot...even grateful for the quick support :100:

romkatv commented 4 years ago

Enjoy the archlinux logo on manjaro! :rocket: :wink:

ankushom19 commented 3 years ago

well can u give the list of codes for the logos

romkatv commented 3 years ago

@ankushom19 Please be more specific.

sachinoliver commented 3 years ago

I do have the penguin logo now..which is default.. How to set kali linux logo in prompt?

romkatv commented 3 years ago

@sachinoliver See https://github.com/romkatv/powerlevel10k/issues/515#issuecomment-589091421. Replace $'\uF303' with the icon of your choice. Kali Linux Logo is not included in any popular fonts, so you'll need to find a font that actually has this glyph and then figure out the UNICODE number of it.

barungh commented 3 years ago

as you have mentioned %B for bold , where do I put %B ?

typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION=%B$'\uF303'

is this correct ?

romkatv commented 3 years ago

as you have mentioned %B for bold , where do I put %B ?

typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION=%B$'\uF303'

is this correct ?

Looks fine to me. (BTW, you can just try things before asking.)

AmielCyber commented 3 years ago

You could go here to search your desired OS icon. https://www.nerdfonts.com/cheat-sheet

Leshu7w7 commented 2 years ago

Hi, how can i change os icon color?

romkatv commented 2 years ago

@Leshu7w7 Open ~/.p10k.zsh, search for POWERLEVEL9K_OS_ICON_FOREGROUND, change its value and restart zsh with exec zsh. See the top of ~/.p10k.zsh for how to choose colors.

wasi-master commented 2 years ago

Kali linux seems to be added to the nerd fonts project, but the font fira code downloaded from their official website still doesn't work for me for some reason, thankfully kali linux has a custom version of the fira code font that works for me, [changelog link]

Kali’s logo is now included in the nerd-fonts project, so, with their next release you’ll be able to customize your terminal with the dragon. If you want to try it now, we’ve created a patched Fira-Code font with these new changes (the code for the logo is \uF32B)

I checked the nerdfonts cheat sheet but couldn't find the icon for kali linux image I did however find it in their source code: image From https://github.com/ryanoasis/nerd-fonts/blob/master/bin/scripts/lib/i_linux.sh#L50

So if anyone wants the kali linux icon they should download the fira code font from the changelog rather than the nerd fonts website

Font from nerdfonts.com image Font from kali linux's changelog image I've also just noticed that the font from the kali linux website has this glitch with the slash?

romkatv commented 2 years ago

@wasi-master Your summary of the changelog doesn't look right. They aren't saying that Kali linux has their own font. They are saying that the next version of nerd-fonts will contain a logo for Kali linux.

wasi-master commented 2 years ago

@romkatv thanks, edited

TechLionDev commented 7 months ago

Where do i pu the typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION=%B$'\uF303'

romkatv commented 7 months ago

The most common place to put it is within ~/.p10k.zsh. If you don't have this file, put it at the bottom of ~/.zshrc.

TechLionDev commented 7 months ago

can i make the ico bigger?

romkatv commented 7 months ago

The icon comes from your font. If you make it bigger in your font, it'll be bigger in the terminal.

TechLionDev commented 7 months ago

and where is the setting to change the GH Octopus? tysm for ur help so far

romkatv commented 7 months ago

POWERLEVEL9K_VCS_GIT_GITHUB_ICON='whatever'

SofiDevO commented 6 months ago

Can I use a custom Logo, exmpl: if it come frome external source or even a svg or png logo/icon?

romkatv commented 6 months ago

The terminal can display glyphs from the font and nothing else. If you want to display something that does not have a glyph in your font, you'll need to create a new font. The most popular free tool for editing fonts is called FontForge. You can use it to create a new font that will have all glyphs from some other font plus an extra glyph. I do not recommend doing this unless you feel very strongly about seeing a particular glyph in your terminal.

Alaponuke commented 3 months ago

just to clarify for future readers, after reading all the threat

  1. enabled the line (character set is for my KDE change \uF373 for any other number you desire ) typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION=$'%B\uF373' and I found my desired Icon character number in this search: https://www.nerdfonts.com/cheat-sheet image

Just to mention is you don not see all the symbols just download and install the symbols font only: image with these steps all is showed

Koxepis commented 2 months ago

I'm using the pure theme on my p10k. But I want to add apple logo displayed. How do I do that? I've tried to put down typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION=%B$'\uF302' but it didn't show anything when sourcing it back with .zshrc

Instead I got this line after source .zshrc:

gitstatus_stop_p9k_:zle:41: No handler installed for fd 13
gitstatus_stop_p9k_:49: failed to close file descriptor 13: bad file descriptor

So I revert it back.

But when I tried to add os_icon like this on line 3:

typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
    # =========================[ Line #1 ]=========================
    os_icon
    # context                 # user@host
    dir                       # current directory
    vcs                       # git status
    # command_execution_time  # previous command duration
    # =========================[ Line #2 ]=========================
    newline                   # \n
    # virtualenv              # python virtual environment
    prompt_char               # prompt symbol
)

It will only display OSX. So can you show me how do I do that @romkatv Thanks.

romkatv commented 2 months ago

The easiest way is to run p10k configure and choose Lean style. Pure style is for those who want the exact prompt provided by https://github.com/sindresorhus/pure.