Comments (9)
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.
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.
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.
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.
from agnoster-zsh-theme.
Would it be possible to do something like this?
from agnoster-zsh-theme.
Importing https://github.com/tomislav/osx-terminal.app-colors-solarized made my Terminal much more readable.
from agnoster-zsh-theme.
@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.
Using Ubuntu, set agnoser theme but after setting powerline, i lost color on my prompt :
Does anyone have encounter that issue ?
from agnoster-zsh-theme.
Related Issues (20)
- Some identification characters cannot be displayed HOT 3
- Display Problem on Ubuntu-18.04
- no display with shell HOT 1
- [help] Change Default path to minified version? HOT 1
- Broken prompt after another oh-my-zsh upgrade HOT 6
- display blanks from webstorm terminal HOT 2
- How can I shorten the prompt? HOT 2
- broken auto complete HOT 1
- An Empty Space Between the Segments on Windows Terminal?
- inside .git folders Agnoster produces "fatal: this operation must be run in a work tree"
- Problem with characters HOT 6
- Anaconda/Miniconda Python Virtual Environment displaying error
- warp Terminal is showing $SEGMENT_SEPARATOR on black when is in a git repo
- Agnoster Prompt triangles look separated HOT 3
- Font issues HOT 2
- Full prompt in same color !! HOT 1
- Please add a license file
- prompt no coloring HOT 1
- Issue with typed text not showing up in cmder
- messed up char on shell prompt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agnoster-zsh-theme.