diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 89 |
1 files changed, 85 insertions, 4 deletions
@@ -145,6 +145,7 @@ The segments that are currently available are: * [`command_execution_time`](#command_execution_time) - Display the time the current command took to execute. * [`todo`](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file. * `detect_virt` - Virtualization detection with systemd +* `newline` - Continues the prompt on a new line. --------------------------------------------------------------------------------- @@ -186,9 +187,8 @@ your `~/.zshrc`: ##### battery -This segment will display your current battery status (fails gracefully on -systems without a battery). It is supported on both OSX and Linux (note that it -requires `acpi` on Linux). +The default settings for this segment will display your current battery status (fails gracefully on +systems without a battery). It is supported on both OSX and Linux (note that it requires `acpi` on Linux). | Variable | Default Value | Description | |----------|---------------|-------------| @@ -203,6 +203,56 @@ Note that you can [modify the `_FOREGROUND` color](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt#segment-color-customization) without affecting the icon color. +You can also change the battery icon automatically depending on the battery +level. This will override the default battery icon. In order to do this, you +need to define the `POWERLEVEL9k_BATTERY_STAGES` variable. + +| Variable | Default Value | Description | +| `POWERLEVEL9K_BATTERY_STAGES`|Unset|A string or array, which each index indicates a charge level.| + +Powerlevel9k will use each index of the string or array as a stage to indicate battery +charge level, progressing from left to right. You can provide any number of +stages. The setting below, for example, provides 8 stages for Powerlevel9k to use. +```zsh +POWERLEVEL9K_BATTERY_STAGES="▁▂▃▄▅▆▇█" +``` + +If you require extra spacing after the icon, you will have to set it as an array, +since spaces in the string will be used as one of the stages and you will get a +missing icon. To do this, declare the variable as follows: +```zsh +POWERLEVEL9K_BATTERY_STAGES=($'\u2581 ' $'\u2582 ' $'\u2583 ' $'\u2584 ' $'\u2585 ' $'\u2586 ' $'\u2587 ' $'\u2588 ') +``` + +Using the array syntax, you can create stages comprised of multiple characters. +The below setting provides 40 battery stages. +```zsh +POWERLEVEL9K_BATTERY_STAGES=( + $'▏ ▏' $'▎ ▏' $'▍ ▏' $'▌ ▏' $'▋ ▏' $'▊ ▏' $'▉ ▏' $'█ ▏' + $'█▏ ▏' $'█▎ ▏' $'█▍ ▏' $'█▌ ▏' $'█▋ ▏' $'█▊ ▏' $'█▉ ▏' $'██ ▏' + $'██ ▏' $'██▎ ▏' $'██▍ ▏' $'██▌ ▏' $'██▋ ▏' $'██▊ ▏' $'██▉ ▏' $'███ ▏' + $'███ ▏' $'███▎ ▏' $'███▍ ▏' $'███▌ ▏' $'███▋ ▏' $'███▊ ▏' $'███▉ ▏' $'████ ▏' + $'████ ▏' $'████▎▏' $'████▍▏' $'████▌▏' $'████▋▏' $'████▊▏' $'████▉▏' $'█████▏' ) +``` + +You can also change the background of the segment automatically depending on the +battery level. This will override the following variables: +`POWERLEVEL9K_BATTERY_CHARGING`, `POWERLEVEL9K_BATTERY_CHARGED`, +`POWERLEVEL9K_BATTERY_DISCONNECTED`, and `POWERLEVEL9K_BATTERY_LOW_COLOR`. In +order to do this, define a color array, from low to high, as shown below: +```zsh +POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND=(196 202 208 214 220 226 190 154 118 82 46) +``` + +As with the battery stages, you can use any number of colors and Powerlevel9k +will automatically use all of them appropriately. + +Some example settings: +|Brightness|Possible Array| +|Bright Colors|(196 202 208 214 220 226 190 154 118 82 46)| +|Normal Colors|(124 130 136 142 148 112 76 40 34 28 22)| +|Subdued Colors|( 88 94 100 106 70 34 28 22)| + ##### command_execution_time Display the time the previous command took to execute if the time is above @@ -214,7 +264,7 @@ If you want more precision, just set the | Variable | Default Value | Description | |----------|---------------|-------------| |`POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD`|3|Threshold above which to print this segment. Can be set to `0` to always print.| -|`POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=2`|2|Number of digits to use in the fractional part of the time value.| +|`POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION`|2|Number of digits to use in the fractional part of the time value.| ##### custom_command @@ -345,6 +395,12 @@ POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{red} $(print_icon 'LEFT_SUBSEGMENT_SEPARATOR To omit the first character (usually a slash that gets replaced if you set `POWERLEVEL9K_DIR_PATH_SEPARATOR`), you could set `POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true`. +You can also customize the leading tilde character when you are in `$HOME` using: +```zsh +# Double quotes are important here! +POWERLEVEL9K_HOME_FOLDER_ABBREVIATION="%F{red} $(print_icon 'HOME_ICON') %F{black}" +``` + ##### disk_usage @@ -418,6 +474,15 @@ segment will not be displayed. |`POWERLEVEL9K_PUBLIC_IP_METHODS`|(dig curl wget)| These methods in that order are used to refresh your IP.| |`POWERLEVEL9K_PUBLIC_IP_NONE`|None|The string displayed when an IP was not obtained| +##### newline + +Puts a newline in your prompt so you can continue using segments on the next +line. This allows you to use segments on both lines, unlike +`POWERLEVEL9K_PROMPT_ON_NEWLINE`, which simply separates segments from the +prompt itself. + +This only works on the left side. On the right side it does nothing. + ##### rbenv This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack. @@ -439,6 +504,7 @@ This segment shows the return code of the last command. |----------|---------------|-------------| |`POWERLEVEL9K_STATUS_VERBOSE`|`true`|Set to false if you wish to not show the error code when the last command returned an error and optionally hide this segment when the last command completed successfully by setting `POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE` to false.| |`POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE`|`false`|Set to true if you wish to show this segment when the last command completed successfully in non-verbose mode.| +|`POWERLEVEL9K_STATUS_SHOW_PIPESTATUS`|`true`|Set to true if you wish to show the exit status for all piped commands.| ##### ram @@ -546,6 +612,21 @@ is count your source files and test files, and calculate the ratio between them. Just enough to give you a quick overview about the test situation of the project you are dealing with. +### Disabling / Enabling Powerlevel9k + +You can disable P9k and return to a very basic prompt at any time simply by +calling: + +```zsh +$ prompt_powerlevel9k_teardown +``` + +You can then re-enable it by calling: + +```zsh +$ prompt_powerlevel9k_setup +``` + ### tl; dr Want to just get a quick start? Check out the [Show Off Your |