powerline-extra-symbols
powerline-extra-symbols copied to clipboard
How to use in P9K Theme?
I playing with zsh, because of changing my terminal from bash to zsh. I found this in https://medium.com/@oldwestaction/beautifying-your-terminal-with-zsh-prezto-powerlevel9k-9e8de2023046.
But i have no idea how to use it.
I like the flames and want to use them in my theme.
At the moment it looks like this:
i want to change alle the left sided indicators with it, but i can't found a solution for it (trying out some fonts, without success.
I hope someone can help me out...
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\UE0C0'
Hi,
Am an noob to zsh and powerline themes. I stumbled over https://github.com/ryanoasis/powerline-extra-symbols and wanted to know how can i setup the Fire/Flame theme.
This is my current terminal view:
I am on oh my zsh, powerline10k and nerd font/hack.
Your help is much appreciated!
Thanks, Keus
I used prezto, but I believe the line I posted above
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\UE0C0'
goes in your .zshrc
. Along with any other customizations.
\UE0C0
denotes the segment you want to use as its Unicode, according to the README of this repo.
I chose to escape the Unicode address instead of pasting in the symbol because things like Github (if you check your dotfiles into a repo for VCS for example) won't render the symbols correctly.
I see you're using macOS. I hope you're using iTerm2. If you are, do note that I ran into some issues with certain symbols. (Specifically the fire one, if I remember correctly.) I seem to remember the author of this repo told someone to select the option to "treat ambiguous width characters as double-width" but I can't remember if that helped.
Oh here it is.
And also, .zshrc
goes in your ~
directory.
Sorry for my inconclusiveness, I don't have the machine I used this on anymore.
@badummtss @Hub-K Did that fix it for you guys? You might also want to set POWERLEVEL9K_RIGHT_SEGMENT_SEPERATOR
and the POWERLEVEL9K_<side>_SUBSEGMENT_SEPERATOR
s for both right and left to give it a more complete look.
Nop, i tried using it with no avail. Here is what i tried:
- I am using PowerLevel10K and not PowerLevel9K
- I am using NerdFonts Hacker font regular
- I tried :
POWERLEVEL9K_RIGHT_SEGMENT_SEPERATOR
POWERLEVEL10K_RIGHT_SEGMENT_SEPERATOR
in./zshrc
with no effect.
is there any preconditions or steps i need to do/install to make this thing work. From what i understand, patched fonts like Hacker Font Regular by NerdFonts should include those separators.
Alrighty. First off, p10k uses POWERLEVEL9K
in its config to maintain forward compatibility with p9k. This way, no changes to config are needed if you are switching to powerlevel10k from p9k. Secondly, ~/.zshrc
should be a dotfile (that is, it has a leading period). If these bits of advice fix your problem, you can skip the rest, but otherwise, get ready to make a really good bug report. (The instructions below are indeed the kind of verbosity I want when reading an issue.)
Also, ./zshrc
isn't enough info--the "dot" directory is relative. Please use absolute directories like ~
(tilde dir; stands for /home/username
) when asking for debugging help.
I will need a ton of info to tell what's going wrong. Please bear with me and paste all of this in, I don't know where the problem is, so I'll need to make sure everything is up-to-date and configured correctly.
- OS name. I assume it's macOS from your above screenshot, but just to make sure.
- OS version. This can be accessed by clicking the apple logo in the top bar and then clicking "about this mac". Hopefully, you're on 10.15.x; upgrade if you can.
- What terminal emulator (terminal) are you using? (Consider using iTerm2 if you aren't already. It's simply the best macOS option by a long shot.)
- The version of your terminal emulator. I think 3.3.7 is the most recent stable release of iTerm2. Again, upgrade if you need to.
- What does
echo $SHELL
print?zsh
right? - What zsh plugin manager, if any, are you using? Does this bundle p10k (as
zprezto
does)? Or did you install via the plugin manager? By cloning the git repo? - Is your plugin manager/all plugins up to date? I don't know what command to run here since you might be using any of several dozen plugin managers, but a quick google search or
--help
flag should reveal the magic command(s). - You've installed
Hacker Font regular NF
on your machine, correct? Via the download link on the nerdfonts homepage, or via the patcher script? - Screenshot your terminal emulator's font settings page. It should have
Hacker Font regular NF
selected. If you're using different fonts for ascii and non-ascii, is the NF one the non-ascii one? - What does your
~/.zshrc
look like? Paste in any relevant bits (i.e. anything that starts withPOWERLEVEL9K
). Your previous comment mentioned only right prompt adjustments, and your left prompt is the main one. You should definitely be adjusting that one. - Finally, and this might be the most helpful bit, screenshot the result when ALL of the following are entered into your
~/.zshrc
:
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\UE0C0'
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\UE0C2'
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\UE0C1'
POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\UE0C3'
Rember to write the file to disk (save it) before looking for a change. In addition, you'll need to open a new terminal window, as ~/.zshrc
is only run upon startup. You might even have to restart your terminal emulator (⌘ Q, then open your terminal emulator again) for the changes to take effect. Or (I know, I know) restart your computer. Ya never know. Restarting is kinda magical.
Overall tips that led me to ask for this:
- Update everything.
- If someone is trying to remotely debug your config, screenshots of the result are immensely helpful.
Also, disclaimer, I'm not the maintainer (of any of the involved projects), I just happen to have some experience with the subject at hand.
- macOS Catalina
- Vserion 10.15.2 (19C57)
- Native and iTerm2
- iTerm2 (Build 3.3.7)
-
/bin/zsh
-
oh my zsh
installed using Curlsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- Yes,
oh my zsh
is updated to date. ranupgrade_oh_my_zsh
- Github repo
https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf
and just click-to-install
10)
ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\UE0C0'
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\UE0C2'
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\UE0C1'
POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\UE0C3'
//Terminal OSX
//iTerm2
Hm. iTerm is certainly doing a better job of rendering your prompt, but neither of them are picking up on your config.
Did you try restarting your computer? Also, you might try moving the POWERLEVEL9K
stuff to different places in your .zshrc
-- I've heard that placing them above or below certain things can stop it from working.
Oooh! What if -- do you have a .p10k.zsh
? If so, you'll want to find those settings (they're set somewhere in there, use your editor's find) and replace them with your own. Then you won't need them in your .zshrc
. That could definitely be it -- sorry about not mentioning that from the first, but I hadn't used p10k in months when I first replied to you.
so i guess i took a step in the right direction, had to put it after the following:
source ~/powerlevel10k/powerlevel10k.zsh-theme
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\UE0C0'
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\UE0C2'
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\UE0C1'
POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\UE0C3'
BUT, it looks so ugly:
-
is there a way to make it have flames after each folder:
Since it looks more like:
-
how can i get the colour scheme (red, orange and yellow)
Thanks in advance
Yes, that is definitely a step in the right direction. You're using p10k, did you ever use the built-in configuration wizard? Did it generate a file? Looking maybe a bit like this?
If so, what you're going to want to do is open that file and make all of your edits there. The comments explain things pretty well and I've been able to customize mine just with the comments and the find feature of my editor. Plus, you won't have any POWERLEVEL9K
stuff in your .zshrc
.
If not, keep making the adjustments in your .zshrc
. Also, it looks like you've selected the "classic" option if you wouldn't mind going in and reselecting the "rainbow" option, that's closer to your desired prompt. And "flat" instead of "faded" edges. Run p10k configure
to do this.
But as for making the prompt look exactly like the maintainers, I'll tag him for you. Hey @ryanoasis how did you make the fire prompt?
And in case he doesn't have a definitive answer (this was like several months ago, if not more, that he made the picture), here are some ideas: Run this
for i in {0..255}; do print -Pn "%${i}F${(l:3::0:)i}%f " ${${(M)$((i%8)):#7}:+$'\n'}; done
to generate your colormap. For me, the firey-est colors are 001, 005, 003, 009, 124, 160, 196, 226. That might be different for you. You'll want to change
POWERLEVEL9K_DIR_BACKGROUND
POWERLEVEL9K_OS_ICON_BACKGROUND
and perhaps
POWERLEVEL9K_TIME_BACKGROUND
POWERLEVEL9K_STATUS_OK_BACKGROUND
to those colors. Along with any others that might show up from time to time, such as:
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND
POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND
And a whole ton of other possible segments. Like so many, it boggles the mind how this theme could possibly have been written. So, you've changed all the colors to firey? Great! The next bit should be easier! Add
POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\UE0C0'
POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\UE0C2'
and you'll have more fire!
And now the hardest part: getting fire instead of slashes for your directories. I have no idea how to do this, but a rough sketch would be:
Find where p10k picks up your current directory from. This might be pwd
, might be something else. You'll need to look at the source code for this, which you probably already have cloned, and it'll be in the file called internal/p10k.zsh
. This 6,000 line beast has a directory segment being built somewhere in there.
Next, you'll need to fork p10k. You'll have to remember to keep to up to date with regular rebases or merges (or make a regularly run script [i.e. via cron
] to automate it). Then you'll need to figure out how to avoid plugin manager conflicts. I use prezto so I don't know how oh-my-zsh works and can't offer any help as to how to do this. You might need to rename it so that the update command doesn't overwrite it with master
of romkatv's version. powerlevel11k
perhaps? Or p10kfire
? If this sounds like too much work, it probably is. I don't maintain personalized forks of things ever and it sounds kinda difficult, tbh, especially in conjunction with a plugin manager.
So now you have a fork and know where the directory segment is coming from internally. Then you'll need to take that text that's getting shipped off to the directory segment and intercept it with some pipes. These should pipe it through some commands to find any forward slashes and replace them with the fire character. My *nix-command-line-fu is very google-reliant, so I'm not sure what commands you'd need to do this. I wouldn't know until I tried.
Sound like a lot of work? It certainly is. Unless someone publishes their config, trying to replicate it is gonna be hard. (P.S. my guess is that Ryan's prompt was actually just something he (looked again and this is in fact a prompt, but not sure if p10k or not.)echo
ed or mocked up in a similar way, so this prompt never has existed as a real prompt. In that screenshot, you can see his actual prompt, ❯
, and his cursor, above and below the fire. Ryan, please correct me if I misrepresent you.)
You are awesome @extremepayne,
Here how it looks like now:
Here is my config:
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\UE0C0'
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\UE0C1'
POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\UE0C0'
#Left Segment
POWERLEVEL9K_DIR_BACKGROUND='166'
POWERLEVEL9K_OS_ICON_BACKGROUND='214'
#Right Segment
POWERLEVEL9K_TIME_BACKGROUND='095'
POWERLEVEL9K_STATUS_OK_BACKGROUND='179'
#Additional
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='178'
POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND='000'
#End
POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\UE0C0'
Remaining issues:
- How can i fix the Right Segment flame alignment, looks ugly due to check mark by
P10K
:
- Do you know how can i change the color of the Right Segment text, its black and i would like to have it white
Thanks a million
You are awesome @extremepayne,
Thanks! Remaining issues:
How can i fix the Right Segment flame alignment, looks ugly due to check mark by
P10K
:
Try adding a space. Before the Unicode, I think. You also might want one afterward on the left side.
Do you know how can i change the color of the Right Segment text, its black and i would like to have it white
So figure out what the segment is called. In this case, it's both COMMAND_EXECUTION_TIME and TIME. Then change POWERLEVEL9K_<segment name>_FOREGROUND
to a numerical value representing white--remember that colormap trick I showed you earlier?
Also, I see you've got a transparent background--iTerm2 has a specific setting to make powerline characters look better with transparency. "Keep background colors opaque" in profiles. See if you like it.
Lastly, and I should have mentioned this earlier, the docs that led me to be so knowledgeable about powerlevel9k/10k are here: https://github.com/Powerlevel9k/powerlevel9k/blob/master/README.md#prompt-customization Some more are here: https://github.com/Powerlevel9k/powerlevel9k/wiki/Stylizing-Your-Prompt And I learned quite a bit from looking at other's configs: https://github.com/Powerlevel9k/powerlevel9k/wiki/Show-Off-Your-Config And most recently from the comments in this file: https://github.com/romkatv/powerlevel10k/blob/master/config/p10k-rainbow.zsh
Try adding a space. Before the Unicode
POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' \UE0C2 '
//Worked !!!
Then change POWERLEVEL9K_
_FOREGROUND
POWERLEVEL9K_TIME_FOREGROUND="255"
Ref: https://github.com/Powerlevel9k/powerlevel9k/wiki/Show-Off-Your-Config
End result:
@extremepayne you are a genius, thanks for helping and bearing with me through all the process, u da b3st.
- is there a way to make it have flames after each folder:
![]()
This should work:
# User-define prompt segment: my_fire_dir.
# It's a good idea to prefix your segments with `my_` to
# avoid clashes with future versions of powerlevel10k.
function prompt_my_fire_dir() {
emulate -L zsh
local split_path=(${(s:/:)${(%):-%~}//\%/%%})
(( $#split_path )) || split_path+=/
if (( $#split_path == 1)); then
p10k segment -s SOLO -b 160 -f 255 -t $split_path
return
fi
p10k segment -s FIRST -b 209 -f 255 -t $split_path[1]
shift split_path
while (( $#split_path > 1 )); do
p10k segment -s EVEN -b 202 -f 255 -t $split_path[1]
shift split_path
(( $#split_path > 1 )) || break
p10k segment -s ODD -b 209 -f 255 -t $split_path[1]
shift split_path
done
p10k segment -s LAST -b 160 -f 255 -t $split_path[1]
}
typeset -g POWERLEVEL9K_MY_FIRE_DIR_LEFT_SEGMENT_SEPARATOR='\uE0C0'
typeset -g POWERLEVEL9K_MY_FIRE_DIR_{LAST,SOLO}_{LEFT_SEGMENT_SEPARATOR,LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL}='\uE0C0'
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(my_fire_dir)
If you've never used p10k segment
before, type p10k help segment
for usage. Also see prompt_example
in your ~/.p10k.zsh
.
Some details about my_fire_prompt
: https://github.com/romkatv/powerlevel10k/issues/114#issuecomment-510589515.