Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/more themes #2

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions contrib/presets/colors/contrast.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

POWERLINE_HOST_COLOR=(15 5)
POWERLINE_USER_COLOR=(15 5)
POWERLINE_PYTHON_ENV_COLOR=(0 3)
POWERLINE_PATH_COLOR=(15 4)
POWERLINE_PATH_SEPARATOR_COLOR=(0 4)
POWERLINE_PATH_LAST_COLOR=(15 4 1)
POWERLINE_PATH_VCS_COLOR=(15 4 1 1)
POWERLINE_PATH_SHORTENED_COLOR=(0 4)
POWERLINE_JOBS_COLOR=(15 4)
POWERLINE_VCS_CLEAN_COLOR=(7 0)
POWERLINE_VCS_DIRTY_COLOR=(3 0)
POWERLINE_VCS_STASH_COLOR=(3 0)
POWERLINE_ERROR_COLOR=(0 9)

POWERLINE_NEUTRAL_COLOR=(7 0)
POWERLINE_AWS_PROFILE_COLOR=(0 10)
POWERLINE_BATTERY_COLOR=(-1 3)
POWERLINE_LOAD_COLOR=(-1 11)
POWERLINE_RAM_COLOR=(-1 3)
POWERLINE_DISK_COLOR=(-1 3)
POWERLINE_TEMPERATURE_COLOR=(0 1)
POWERLINE_CHROOT_COLOR=(0 5)

POWERLINE_DIRSTACK_COLOR=(15 4)
POWERLINE_GAP_COLOR=(0 0)
POWERLINE_KUBECONTEXT_COLOR=(0 10)
POWERLINE_LINE_COLOR=(14 -1)
POWERLINE_NODE_ENV_COLOR=(0 10)
POWERLINE_PROXY_COLOR=(4 7)
POWERLINE_ENV_VARS_COLOR_SET=(0 5)
POWERLINE_ENV_VARS_COLOR_UNSET=(13 7)

# Pre-set for having access to the actual escaped string.
lp_terminal_format ${POWERLINE_ENV_VARS_COLOR_SET[@]}
POWERLINE_ENV_VARS_SET="$lp_terminal_format"
lp_terminal_format ${POWERLINE_ENV_VARS_COLOR_UNSET[@]}
POWERLINE_ENV_VARS_UNSET="$lp_terminal_format"

POWERLINE_RUBY_ENV_COLOR=(0 10)
POWERLINE_CMAKE_COLOR=(0 10)
POWERLINE_RUNTIME_COLOR=(15 4)
POWERLINE_SHLVL_COLOR=(15 5)
POWERLINE_SOFTWARE_COLLECTIONS_COLOR=(0 10)
POWERLINE_TAG_COLOR=(12 15)
POWERLINE_TERRAFORM_ENV_COLOR=(0 10)
POWERLINE_MODULES_COLOR=(0 10)
POWERLINE_OS_COLOR=(0 10)
POWERLINE_TIME_COLOR=(0 7)
POWERLINE_WIFI_STRENGTH_COLOR=(-1 3)
POWERLINE_DISPLAY_COLOR=(0 13)

34 changes: 34 additions & 0 deletions contrib/presets/colors/legacy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
POWERLINE_HOST_COLOR=(220 166 0 0 3 2)
POWERLINE_USER_COLOR=(231 31 1 0 7 6)
POWERLINE_PYTHON_ENV_COLOR=(231 74 0 0 7 4)
POWERLINE_PATH_COLOR=(250 240 0 0 7 0)
POWERLINE_PATH_SEPARATOR_COLOR=(245 240 0 0 7 0)
POWERLINE_PATH_LAST_COLOR=(252 240 1 0 7 0)
POWERLINE_PATH_VCS_COLOR=(147 240 1 0 4 0)
POWERLINE_PATH_SHORTENED_COLOR=(245 240 0 0 7 0)
POWERLINE_JOBS_COLOR=(220 166 0 0 3 2)
POWERLINE_VCS_CLEAN_COLOR=(250 236 0 0 7 0)
POWERLINE_VCS_DIRTY_COLOR=(220 236 0 0 3 0)
POWERLINE_VCS_STASH_COLOR=(220 236 0 0 3 0)
POWERLINE_ERROR_COLOR=(231 52 0 0 7 1)

POWERLINE_NEUTRAL_COLOR=(252 234 0 0 7 0)
POWERLINE_AWS_PROFILE_COLOR=(190 236 0 0 3 0)
POWERLINE_BATTERY_COLOR=(-1 238 0 0 -1 0)
POWERLINE_CHROOT_COLOR=(219 30 0 0 7 4)
POWERLINE_CONTAINER_COLOR=("${POWERLINE_NEUTRAL_COLOR[@]}")
POWERLINE_DIRSTACK_COLOR=("${POWERLINE_NEUTRAL_COLOR[@]}")
POWERLINE_KUBECONTEXT_COLOR=(231 74 0 0 7 4)
POWERLINE_LOAD_COLOR=(-1 148 0 0 -1 3)
POWERLINE_NODE_ENV_COLOR=("${POWERLINE_PYTHON_ENV_COLOR[@]}")
POWERLINE_PROXY_COLOR=(21 219 1 0 4 7)
POWERLINE_RUBY_ENV_COLOR=("${POWERLINE_PYTHON_ENV_COLOR[@]}")
POWERLINE_RUNTIME_COLOR=(226 17 0 0 3 4)
POWERLINE_SHLVL_COLOR=(231 58 0 0 7 2)
POWERLINE_SOFTWARE_COLLECTIONS_COLOR=(231 62 0 0 7 5)
POWERLINE_TEMPERATURE_COLOR=(-1 240 0 0 -1 0)
POWERLINE_TERRAFORM_ENV_COLOR=(231 182 0 0 7 4)
POWERLINE_TIME_COLOR=(33 17 0 0 5 4)
POWERLINE_WIFI_STRENGTH_COLOR=(-1 148 0 0 -1 3)

# vim: ft=sh et sts=4 sw=4 tw=120
4 changes: 3 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ Powerline style.

install
theme/powerline
theme/powerline_full
theme/powerline_plus
theme/power2lines
theme/powerpuff
10 changes: 6 additions & 4 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
GitHub
Kubernetes
Powerline
Terraform
chroot
config
CMake
GitHub
hostname
js
Kubernetes
Powerpuff
Powerline
runtime
Terraform
username
workspace
Binary file added docs/theme/images/power2lines-long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/theme/images/power2lines-med.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/theme/images/power2lines-short.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/theme/images/powerline-long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/theme/images/powerline-med.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/theme/images/powerline-short.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/theme/images/powerline_full-long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/theme/images/powerline_full-med.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/theme/images/powerline_full-short.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/theme/images/powerpuff-long.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/theme/images/powerpuff-med.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/theme/images/powerpuff-short.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/theme/power2lines.rst
nojhan marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Power2lines
***********

This ``power2line`` theme rearranges the sections of :doc:`powerline_plus`,
but on two rows instead of one.
That is, the data sections are displayed on a first row, and the interactive
prompt forms a second row.
This gives room for long command lines, and let the user find the prompt always
at the same location.


Preview
=======

If there is nothing special about the current context, the appearance of
Powerline might be as simple as this:

.. image:: images/power2lines-short.png

A slightly longer prompt with more data:

.. image:: images/power2lines-med.png

When Liquid Prompt is displaying nearly everything, it may look like this:

.. image:: images/power2lines-long.png


Setup & Configuration
=====================

This theme as the same core configuration than the :doc:`powerline_plus` theme.

Theme Configuration
-------------------

Colors
______

.. attribute:: POWERLINE_LINE_COLOR
:type: array<int>
:value: (240 -1 0 0 14 -1)

Color of the decorative lines.

2 changes: 1 addition & 1 deletion docs/theme/powerline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ When Liquid Prompt is displaying nearly everything, it may look like this:
The above "everything" image looks like it is missing some parts because this
theme does not implement all data sources of Liquid Prompt. This is by design
to clone basic Powerline. For a Powerline theme that does show all data
sources, see :doc:`powerline_full`.
sources, see :doc:`powerline_plus`.

Configuration
=============
Expand Down
49 changes: 45 additions & 4 deletions docs/theme/powerline_full.rst → docs/theme/powerline_plus.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Powerline Full
Powerline Plus
**************

.. contents::
:local:

An extension of the :doc:`powerline` theme, ``powerline_full`` includes all data
An extension of the :doc:`powerline` theme, ``powerline_plus`` includes all data
sources that Liquid Prompt provides. The ordering is the same as the default
theme.

Expand Down Expand Up @@ -41,8 +41,13 @@ All Liquid Prompt config options are respected, **except for**:

* :attr:`LP_COLOR_AWS_PROFILE`
* :attr:`LP_COLOR_CONTAINER`
* :attr:`LP_COLOR_CMAKE_DEBUG`
* :attr:`LP_COLOR_CMAKE_RELEASE`
* :attr:`LP_COLOR_CMAKE_RWDI`
* :attr:`LP_COLOR_DIRSTACK`
* :attr:`LP_COLOR_ERR`
* :attr:`LP_COLOR_ENV_VARS_UNSET`
* :attr:`LP_COLOR_ENV_VARS_SET`
* :attr:`LP_COLOR_HOST`
* :attr:`LP_COLOR_IN_MULTIPLEXER`
* :attr:`LP_COLOR_JOB_D`
Expand All @@ -52,6 +57,7 @@ All Liquid Prompt config options are respected, **except for**:
* :attr:`LP_COLOR_MARK_ROOT`
* :attr:`LP_COLOR_MARK_SUDO`
* :attr:`LP_COLOR_MARK`
* :attr:`LP_COLOR_MODULES`
* :attr:`LP_COLOR_NODE_VENV`
* :attr:`LP_COLOR_NOWRITE`
* :attr:`LP_COLOR_PATH_ROOT`
Expand All @@ -78,11 +84,16 @@ All Liquid Prompt config options are respected, **except for**:
* :attr:`LP_MARK_BRACKET_CLOSE`
* :attr:`LP_MARK_BRACKET_OPEN`
* :attr:`LP_MARK_BZR`
* :attr:`LP_MARK_CMAKE`
* :attr:`LP_MARK_DEFAULT`
* :attr:`LP_MARK_DISABLED`
* :attr:`LP_MARK_FOSSIL`
* :attr:`LP_MARK_GIT`
* :attr:`LP_MARK_HG`
* :attr:`LP_MARK_MODULES_OPEN`
* :attr:`LP_MARK_MODULES_SEP`
* :attr:`LP_MARK_MODULES_CLOSE`
* :attr:`LP_MARK_OS_SEP`
* :attr:`LP_MARK_PERM`
* :attr:`LP_MARK_PREFIX`
* :attr:`LP_MARK_PROXY`
Expand All @@ -92,15 +103,15 @@ All Liquid Prompt config options are respected, **except for**:
Theme Configuration
-------------------

Powerline Full uses all the config options of the :doc:`powerline` theme,
Powerline Plus uses all the config options of the :doc:`powerline` theme,
**except for**:

* :attr:`POWERLINE_STASH_MARKER`
* :attr:`POWERLINE_VCS_DIRTY_COLOR`
* :attr:`POWERLINE_VCS_MARKER`
* :attr:`POWERLINE_VCS_STASH_COLOR`

Powerline Full adds these config options:
Powerline Plus adds these config options:

Markers
_______
Expand Down Expand Up @@ -184,6 +195,12 @@ ______

Color for the chroot section.

.. attribute:: POWERLINE_CMAKE_COLOR
:type: array<int>
:value: (0, 123, 0, 0, 0, 10)

Color for the CMake section.

.. attribute:: POWERLINE_CONTAINER_COLOR
:type: array<int>
:value: $POWERLINE_NEUTRAL_COLOR
Expand All @@ -196,6 +213,18 @@ ______

Color for the directory stack section.

.. attribute:: POWERLINE_ENV_VARS_COLOR_SET
:type: array<int>
:value: (0 250 0 0 0 13)

Color for segment of user-defined environment variables that are set.

.. attribute:: POWERLINE_ENV_VARS_COLOR_UNSET
:type: array<int>
:value: (7 246 0 0 7 5)

Color for segment of user-defined environment variables that are unset.

.. attribute:: POWERLINE_KUBECONTEXT_COLOR
:type: array<int>
:value: (231, 74, 0, 0, 7, 4)
Expand All @@ -208,6 +237,12 @@ ______

Color for the CPU load section.

.. attribute:: POWERLINE_MODULES_COLOR
:type: array<int>
:value: (0 158 0 0 0 10)

Color for the Environment Modules section.

.. attribute:: POWERLINE_NEUTRAL_COLOR
:type: array<int>
:value: (252, 234, 0, 0, 7, 0)
Expand All @@ -221,6 +256,12 @@ ______

Color for the Node.js environment section.

.. attribute:: POWERLINE_OS_COLOR
:type: array<int>
:value: (0 194 0 0 0 10)

Color for the Operating System section.

.. attribute:: POWERLINE_PROXY_COLOR
:type: array<int>
:value: (21, 219, 1, 0, 4, 7)
Expand Down
40 changes: 40 additions & 0 deletions docs/theme/powerpuff.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Powerpuff
*********

This ``powerpuff`` theme go even further in rearranging the sections of the
:doc:`powerline_plus` theme:

- Data sections are spread on two rows,
- each of which has a left-aligned and a right-aligned section.
- A third row hosts the actual interactive prompt.
- A horizontal line link the left and right sections of the first line.
- A new line is drawn before the first row.

The meta-sections are thus less prone to move around when more data is
displayed, and the user will find it easier to spot new information.
The horizontal line and the new line gap also helps in parsing screens with a
lot of history.


Preview
=======

If there is nothing special about the current context, the appearance of
Powerline might be as simple as this:

.. image:: images/powerpuff-short.png

A slightly longer prompt with more data:

.. image:: images/powerpuff-med.png

When Liquid Prompt is displaying nearly everything, it may look like this:

.. image:: images/powerpuff-long.png


Setup & Configuration
=====================

This theme as the same core configuration than the :doc:`power2lines` theme.

Loading
Loading