Code Monkey home page Code Monkey logo

Comments (9)

mkamayd avatar mkamayd commented on June 25, 2024 28

Just changing the color value from a color picker (Preference/Profile/Colors) is already working and it is very convenient as it give you real time update.

from agnoster-zsh-theme.

apjanke avatar apjanke commented on June 25, 2024 26

Agnoster is designed for use specifically with the "Solarized" color palette, which defines a specific mapping of terminal palette ANSI colors to specific RGB values. And also recommends particular uses for those tones.

I.e., this is how you're supposed to use them:

So, @sevaho and @mkamayd, you're not really supposed to change your terminal color settings like that; you're supposed to set your ANSI Color palette to Solarized and leave it there.

Within that Solarized recommendation, though, there's leeway for which particular content/background/accent colors you're using for what role. And maybe people want to customize that?

What @Billy- links to (the OMZ fork of Agnoster) is a reasonable way to do this, IMHO. It rearranges the roles of the Solarized colors, without changing the mapping of the palette colors to RGB values. This has the advantage that you could change the color role mapping in your ~/.zshrc config file, and then it would work in all terminals that you had configured to use Solarized.

from agnoster-zsh-theme.

jacobgershon avatar jacobgershon commented on June 25, 2024 15

Maybe you want to cd to the theme folder:

cd ~/.oh-my-zsh/themes 

Then, open file to custom colors:

nano agnoster.zsh-theme

Comment the prompt_context to make dir become shorter.

## Main prompt
build_prompt() {
  RETVAL=$?
  prompt_status
  prompt_virtualenv
  ## prompt_context
  prompt_dir
  prompt_git
  prompt_bzr
  prompt_hg
  prompt_end
}

At the last, find what you want to change. For example, I'll change background color of dir (from blue to red):

# Dir: current working directory
prompt_dir() {
  prompt_segment red $CURRENT_FG '%~'
}

from agnoster-zsh-theme.

sevaho avatar sevaho commented on June 25, 2024 13

There are different ways in customizing your colors and depends on what setup you have.

The way I changed colors is I am using termite terminal and here you can specify colors like:

# black
color0  = #303030
color8  = #50524E

# red
color1  = #F34F4F
color9  = #993E3E

and now you can change the colors in your agnoster.zsh-theme file like:

prompt_context() {
  local user=`whoami`

  if [[ "$user" != "root" || -n "$SSH_CONNECTION" ]]; then
    prompt_segment blue white " %(!.%{%F{black}%}.)$user "
  else
    prompt_segment red black " %(!.%{%F{black}%}.) $user "
  fi
}

So red will match with #F34F4F (color1).

Hope this helps a bit.

EDIT:

I just found out that you can use 256 colors, for this your terminal needs to understand 256 colors.

So what you can do is just specify a 256 color in the .zsh-theme file like:

prompt_context() {
  local user=`whoami`

  if [[ "$user" != "root" || -n "$SSH_CONNECTION" ]]; then
    prompt_segment 234 54 " %(!.%{%F{black}%}.)$user "
  else
    prompt_segment 12 65 " %(!.%{%F{black}%}.) $user "
  fi
}

from agnoster-zsh-theme.

Billy- avatar Billy- commented on June 25, 2024 1

from agnoster-zsh-theme.

Billy- avatar Billy- commented on June 25, 2024

Would it be possible to do something like this?

from agnoster-zsh-theme.

paulschreiber avatar paulschreiber commented on June 25, 2024

Importing https://github.com/tomislav/osx-terminal.app-colors-solarized made my Terminal much more readable.

from agnoster-zsh-theme.

lestofante avatar lestofante commented on June 25, 2024

@apjanke AFAIK the solution from @Billy- make possible to have different color based on different user or other conditional, like having a red bad for root.
In my case with many ssh machine connected, it helps a lot as color are way more immediate than reading the host name.

from agnoster-zsh-theme.

Waxoussou avatar Waxoussou commented on June 25, 2024

Using Ubuntu, set agnoser theme but after setting powerline, i lost color on my prompt :
image
Does anyone have encounter that issue ?

from agnoster-zsh-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.