DEV Community

loading...
Cover image for #3 Setting an awesome terminal - Part 2

#3 Setting an awesome terminal - Part 2

Arthur Borges
Coming from an Electrical Engineering background, but loved computers since childhood tech movies. Now I finally made the transition from engineering to software. Oh, and I prefer jewels to snakes!
Updated on ・2 min read

(Cover photo by Arget)

So, let's continue with the tutorial on how to set and customize a Powerlevel10k terminal on Ubuntu 20.04.

  1. Reach Powerlevel10k repository.
  2. Install another font (Yes, the video tutorial is based on powerlevel9k and installed Hack, but as we are going to install 10k version, they recommend installing MesloLGS NF Regular).
  3. Install for Oh My Zsh
  4. Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
  5. Restart Zsh
  6. Follow instructions of Powerlevel Configuration Wizard to customize

I begin following the video but then looked only on powerlevel10k for instructions. Here are the settings that I choose on the first run:

  • To the first questions I choose yes, as all the icons appeared correctly.
  • Then I choose Rainbow style (The one of my Dreams -)
  • I then choose Unicode
  • And then 24-hour format
  • Angled Separator
  • Sharp separator to head
  • Choose flat to the tail
  • Two lines for prompt height
  • Prompt Connection: Disconnected
  • Prompt Frame: Left
  • Frame color: Light
  • Prompt space: Sparse
  • Icons: Many icons (Icons everywhere!! o/// )
  • Prompt flow: Concise (less is more)
  • Enable Transient Prompt: Yes (to make it cleaner)
  • Instant Prompt: Verbose (I was unsure about what this item means)
  • Applied changes to ./zshrc

After those configurations here is the result:

powerlevel10k-arthur

I found it very neat! The "Enable Transient Prompt" feature makes the interface very clean and minimalistic. Now I will inspect the .zshrc file and change the prompt flow feature to fluent and change some colors. I will set the background of terminal to black transparent and the colors of powerlevel10k to the fluorescent neon trio:

Neon-colors

I had to run the following command to see the colors supported by my terminal (I as willing to find a hexadecimal support...)

for i in {0..255}; do print -Pn "%K{$i}  %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done
Enter fullscreen mode Exit fullscreen mode

In my terminal (Zsh - Oh My Zsh) I found the following correlations of color:

Color Name Hexadecimal Terminal Color Code
UFO Green #7FFF00 040
Plastic Pink #FF1493 198
Proton Purple #BA2BE2 129

I could set the color of POWERLEVEL9K_DIR_BACKGROUND to 129, and now my terminal became purple. I couldn't find the config to set the prompt flow, so I think I will run the configuration script again to set it easily. Here is my workflow so far:

Transparent Workflow

As I mainly use this laptop alone, without external monitor and it has only 14 inches of screen with HD resolution, I prefer to maintain my terminal transparent. That way I can see through them.

What I learned with all this experience is that terminal customization is fun, but vastly. It is an ongoing process, so I will finish this topic for now. On the next ones, I will be focusing on programming by itself. And you? Do you want to customize your setup? Have a specific preference and color palette? Share those below!

Discussion (4)

Collapse
romkatv profile image
Roman Perepelitsa

Instant Prompt makes prompt appear instantly when you start zsh. It affects only the very first prompt after zsh starts. Try typing zsh and note how fast you get to see prompt. Now try the same with POWERLEVEL9K_INSTANT_PROMPT=off zsh. Note the lag. It can be quite high if you load many plugins. With instant prompt you always get your prompt instantly. If this isn't very clear, check out github.com/romkatv/powerlevel10k/b.... You might have to watch the gif a few times to understand what exactly instant prompt does.

You can set colors with #RRGGBB notation: POWERLEVEL9K_DIR_BACKGROUND='#BA2BE2'. However, most people who use Rainbow style prefer changing terminal colors by modifying terminal settings. See github.com/romkatv/powerlevel10k/b....

If you want to change something for which there was an option in the wizard, it's indeed easier to run p10k configure than to figure out how to manually change your config. For some options these changes aren't very difficult (e.g., sparse prompt vs compact is just POWERLEVEL9K_PROMPT_ADD_NEWLINE set to true vs false) but for others it's really involved (e.g., Rainbow vs Lean).

Collapse
arthurborges profile image
Arthur Borges Author

Thank you a lot for your reply and tips, Roman! I feel honored!

Yesterday, after installing VSCode, I managed to edit some simple configurations and colors, and it was easier than trying to do them in the nano editor. Now my terminal setup is looking like this:

Neon-terminal

I also integrated it to VSCode, and solved the icons problems by including this line of code in settings.json:

"terminal.integrated.fontFamily": "MesloLGS NF"

Collapse
romkatv profile image
Roman Perepelitsa

Nice!

When the novelty of fancy prompt wears off, give Lean style a try. Prompt is no doubt important but it shouldn't steal all your attention away from the real content -- commands and their outputs.

Thread Thread
arthurborges profile image
Arthur Borges Author

Humm... ok! Great advice!

Forem Open with the Forem app