CodexLink / chips.omp.json

A Non-Compliant-Inspired Oh-My-Posh Theme from the Material Design Component: Chips
Apache License 2.0
2 stars 0 forks source link
oh-my-posh oh-my-posh-theme

chips.omp.json

The passively-active, with cutting edge release development repository for the Oh-My-Posh Theme Based on Material Design Component: Chips.

chips.omp.json highlight #1 chips.omp.json highlight #2 chips.omp.json highlight #3

Designed to be compatible for translucent, dark-and-white-influenced background prompts with monospaced style and downscaled (nerd) icon fonts.

Based on Material Design Components: Chips, which allows for data to be displayed elegantly by separating them by chips. Color paletted is based on Material Colors varying from A100 to A400 Color Palettes. More examples below.

Notice

Features

Installation

  1. Click on the theme file in this repository, then right-click the Raw button and save it as chips.omp.json to your designated directory (by default it should be at your home directory).
  2. On your powershell profile ($PROFILE), invoke the theme to the oh-my-posh arguments.

    oh-my-posh --config ~/chips.omp.json --init --shell pwsh | Invoke-Expression

  3. Restart your prompt or refresh your prompt by running the following command: . $PROFILE and you are good to go!

Environment Variables

The theme is designed to be flexible as possible by providing users a choice of filling up the following environment variables that allows for a segment to disappear or explicitly otherwise.

Env. Var. (Append DISABLE_SEGMENT with prefixes _) Type Default Value Functionality (Description)
ENABLE_ARROW
_DIVIDER_COLOR_EXECUTION_RETURN
bool False ($false) Allow for the execution return state color to paint the arrow near the input buffer as an additional indication aside from the transient prompt state. See more samples for the context.
_BATTERY bool False ($false) Hides the BATTERY segment found on the top-right of the prompt when value is set to True ($true).
_DTIME bool False ($false) Hides the DTIME segment found on the top-right of the prompt when the value is set to True ($true).
_PROJECT_CRYSTAL bool False ($false) Hides the CRYSTAL segment found on the bottom-left prompt along with the input buffer when the value is set to True ($true).
_PROJECT_FLUTTER bool False ($false) Hides the FLUTTER segment found on the bottom-left prompt along with the input buffer when the value is set to True ($true).
_PROJECT_LUA bool False ($false) Hides the LUA segment found on the bottom-left prompt along with the input buffer when the value is set to True ($true).
_PROJECT_NODE bool False ($false) Hides the NODE segment found on the bottom-left prompt along with the input buffer when the value is set to True ($true).
_PROJECT_RUST bool False ($false) Hides the RUST segment found on the bottom-left prompt along with the input buffer when the value is set to True ($true).
_PROJECT_PYTHON bool False ($false) Hides the PYTHON segment found on the bottom-left prompt along with the input buffer when the value is set to True ($true). This ignores the value of DISABLE_SEGMENT_PROJECT_PYTHON_VENV.
_PROJECT_PYTHON_VENV bool False ($false) Hides the PYTHON_VENV string display after venv detection when the value is set to True ($true). This ignores the value of SEGMENT_PROJECT_PYTHON_ACTIVE_VENV_STR.
_PRIMARY_EXEC_TIME bool False ($false) Hides the execution time that is shown (in the primary prompt, top-right) after a command has been executed.
_TRANSIENT bool False ($false) Completely hides the transient segment that contains previous command's return code and execution time when the value is set to True. This ignores the value of DISABLE_SEGMENT_TRANSIENT_EXEC_TIME.
_TRANSIENT_EXEC_TIME bool False ($false) Hides the execution time of the the transient prompt based on the recent command before the transient prompt.
_WAKATIME bool False ($false) Hides the WAKATIME segment. Note that the segment is still active when WAKATIME_API_KEY is valid to be queued for new data. This feature is only useful when you wanted to hide the segment when the prompt's width makes the prompt display undesirable, but still wants it to be accessible later without reconfiguring your $PROFILE.
OVERRIDE_FOLDER_BADGE
BG
string p:c-badge-folder (theme-defined palette) Customizes the background of the folder segment from the top-left of the prompt display.
OVERRIDE_FOLDER_BADGE
FG
string p:c-badge-text (theme-defined palette) Customizes the foreground of the folder segment from the top-left of the prompt display.
SEGMENT_PROJECT
PYTHON_ACTIVE_VENV_STR
string None Alternatively replaces the name of the venv that is currently activated from the prompt. This is useful when the length of the name disrespects the space of your input buffer.
WAKATIME_
API_KEY
string None The string that contains the API key that can make the prompt engine queue for new data for every CACHE_TIMEOUT.

Notes to Consider

  1. Please note that these environment variables are purely optional, explicitly declaring them is fine, but this does not mean anything unless their values are the opposite of what is provided in their default values.
  2. These environment variables are accessible in runtime or once they are loaded. You do not need to modify $PROFILE or the theme itself if these changes are temporary. The theme will adjust in an-instant.
  3. Despite adjusting the environment variables both via $PROFILE and by on runtime, you do not need to restart your prompt for the changes to take effect.
  4. Some segments cannot be disabled because they are the vital part of the theme. Those segments are: Folder, and Git.

Showcase

Please understood that the theme may look different depending on your configuration such as the font ligatures embedded on your custom font, your prompt and other factors that affects the visuals of your prompt. Please see my dotfiles and check the folder dist/font and cli/win32 if you want to get the same feeling (ie. command-hinting, command-shortcut, etc.) and font + glyphs rendering.

Note that my custom font has issues in regards to single-width and double-width for other icons, some icons went smaller than what is being rendered from the oh-my-posh config export renderer.

Also please note, the screenshots provided here has a parsing error for the wakatime, rendering the wakatime segment have a same cyan-like color when it shouldn't be, the section showcasing the On-Spot Prompt Adjustment and its preceeding sections shows the fixed color render for the wakatime segment, where I just noticed and was able to fix it in v1.0.0.

Environment Variable Render Variants

[![chips.omp.json env showcase](https://github.com/CodexLink/chips.omp.json/blob/latest/assets/highlight_env_variants.png)](https://ohmyposh.dev/docs/themes#chips)

Git States Segment

[![chips.omp.json git states showcase #1](https://github.com/CodexLink/chips.omp.json/blob/latest/assets/highlight_git_states_1.gif)](https://ohmyposh.dev/docs/themes#chips) [![chips.omp.json git states showcase #2](https://github.com/CodexLink/chips.omp.json/blob/latest/assets/highlight_git_states_2.gif)](https://ohmyposh.dev/docs/themes#chips)

SSH and Root Privilege State Segments

[![chips.omp.json ssh and root showcase](https://github.com/CodexLink/chips.omp.json/blob/latest/assets/highlight_ssh_and_root_variants.png)](https://ohmyposh.dev/docs/themes#chips)

On-The-Spot Prompt Adjustment

Please note that this is also possible when modifying $PROFILE. Just reload the prompt with . $PROFILE and the changes will be reflected.

Also note that I adlib this demonstration, more information and other hideable segments in the Environment Variables section.

chips.omp.json on-the-spot env. change

Transient Prompt with Insights of Previous Command

[![chips.omp.json transient showcase](https://github.com/CodexLink/chips.omp.json/blob/latest/assets/highlight_transient.gif)](https://ohmyposh.dev/docs/themes#chips)

More Samples: Uncategorized

This section contains slightly out-of-context images of the prompt. This may specifically highlights how it looks like after some work done.

More pictures will be added soon, as if I can remember it.

Time Execution as Spent on nvim

chips.omp.json, more sample, transient + console state

After pushing something in git

chips.omp.json, more sample, git push console state

Bug notice: The 100% battery bar display is already fixed.

Extra-complicated git status

chips.omp.json, more sample, git complicated display console state

Context: I was having a hard time with my PR getting conflict to another branch.

Bare-minimum console display

chips.omp.json, more sample, bare-minimum display console state

Convoluted, overdetailed console display

chips.omp.json, more sample, convoluted display console state

Git: Disconnected/unrecognized/no-remote branch status display

chips.omp.json, more sample, git unrecognized branch console state

Arrow Near Input Buffer, Inherit Execution Return Color as Additional Indicator

chips.omp.json, more sample, arrow input buffer inherit execution color state

TODO Features

None as of now. Have something to suggest? Let me know through issue! (And also by tagging me to the context as well~)

Note that, if you are going to suggest soemthing that is out of this list, you have to make sure that the language is supported from one of the segments offered in Oh-My-Posh Segment Section. Otherwise, request a segment feature from the maintainer and let me know if you want to have it included, once implemented.

FAQ

  1. The prompt feels quite slow...

    There are two verdicts. [a] The data being queued from the both local (which is 'git', it parses your branch and repo state, note that I did not use posh-git in this theme, see FAQ #5. In terms of being slow, see this FAQ entry.) and from remote (via HTTP, queueing Wakatime stats (if possible)). And your powershell (pwsh) version (You need to upgrade as upstream as possible). The figure below shows the debug output just from typing oh-my-posh debug.

  2. Why transient prompt contains one-liner that contains multiple segments?

    Accoding to the docs and as per explanation provided by the creator from my issue, 'transient prompt` use case is intended to be more simplier than the other prompt because its nature was to provide a clean output from other prompts. With its feature limitation, I want to do more than just that, by providing previous and current insights about the command, I was able to create or manifest the structure of the segment to be more the same as how I display other segment from other prompt.

  3. Sometimes my prompt just hangs. Why?

    If you are using Wakatime, you have to keep note that the cache time is set to 5m or 5 minutes by default. Therefore, every 5 minutes, the prompt will do an HTTP request to get the latest upstream of your stats. If you are not using Wakatime and this issue occurs, please investigate the state of the prompt by debugging it (with the use of oh-my-posh debug). Please let me know with sufficient information if it persists.

  4. Why did you not use posh-git? git segment is slower right?

    I'm aware. oh-my-posh posh-git docs doesn't show any examples or further modification than what is being provided in the git segment. While I do understand the compromise of performance over customization, I think its best to customize the output to further understand more about what are the symbols behind them. Because in my perspective, I'm pretty much confused about it. To solve the contention from this issue, I'm hoping that posh-git is customizable as git segment.

  5. What are your basis for the wakatime's timeout values?

    They were based on my preference with consideration on my ISP speed. Please adjust them from the theme itself. Environment Variables for adjusting parameters such as timeouts were not supported as of 08/29/2022. Let me know if it is because I also need it.

  6. Why does the Code Return sometimes returns high value of signed int or just big numbers?

    I'm not quite sure why, but usually when a program has crashed, they will return a reference code or sometimes address that points to the point of error. Though this was just an assumption but its something related to that.

  7. Why this theme is only designed for monospaced and consistently-single-width?

    If you have seen the snapshot from the oh-my-posh website, as well as from the issue, the theme looks ugly as heck to the point where the used icons are cherry-picked to display properly when the font has a small-scaled nerd icon font.

    Some similar icons have lower or higher scale, which is the exact reason why some icons are picked, and not first candidates were used for designing the theme.

    Other than that, the spacing added in the theme feels lacking or non-existent if the user is using a font that has a default-scaling of nerd font icons, looking like there's no spacing when in fact, there's a spacing between the string and the icon from the first place.

    Either way, I'm actively open to create a solution for users having this kind of issue and is open for creating an alternative theme.

Further more questions? Let me know in the Issue section.

Tools

Contribution

— I don't have plans for the formal contribution, but contributions of any forms are welcomed. We know its typical to create issue for discussion before PR.

Credits