From 1a5edebae76586361258ab68cb3f26148dfe026e Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Mon, 21 Sep 2015 18:27:03 +0200 Subject: Added a segment that shows the current GO version number. --- README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'README.md') diff --git a/README.md b/README.md index 98033e79..6dfd7240 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,7 @@ currently available are: * **context** - Your username and host (more info below) * **vi_mode** - Vi editing mode (NORMAL|INSERT). * **dir** - Your current working directory. +* **go_version** - Show the current GO version. * **history** - The command number for the current line. * **ip** - Shows the current IP address. * **load** - Your machines 5 minute load average and free RAM. -- cgit v1.2.3 From 2a1718d927c2805e68ed3bb5d92ccd0113a464a4 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:17:47 -0700 Subject: README: moving lots of information to the Wiki --- README.md | 315 ++++++++++++++------------------------------------------------ 1 file changed, 71 insertions(+), 244 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index f0c37847..b56df188 100644 --- a/README.md +++ b/README.md @@ -92,149 +92,30 @@ varying terminal status indicators: ![](http://bhilburn.org/content/images/2014/12/powerlevel9k.png) ### Installation -There are two steps to start using this theme: +There are two installation steps to go from a lame terminal to a "Power Level +9000" terminal. Once you are done, you can optionally customize your prompt. -1. Install the Powerlevel9k theme. -2. Install Powerline-patched fonts. -3. [Optional] Configuration - -To get the most out of Powerlevel9k, you need to install both the theme as well -as Powerline-patched fonts, if you don't have them installed already. If you -cannot install Powerline-patched fonts for some reason, follow the instructions -below for a `compatible` install. +[Installation Instructions](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions) +1. [Install the Powerlevel9k Theme](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-1-install-powerlevel9k) +2. [Install Powerline-Patched Fonts](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-2-install-powerline-fonts) No configuration is necessary post-installation if you like the default -settings, but there is plenty of segment configuration available if you are -interested. - -#### Step 1: Install Powerlevel9k -There are four ways to install and use the Powerlevel9k theme: vanilla ZSH, -Oh-My-Zsh, Prezto, and antigen. Do one of the following: - -##### Option 1: Install for Vanilla ZSH - -If you use just a vanilla ZSH install, simply clone this repository and -reference it in your `~/.zshrc`: - - $ git clone https://github.com/bhilburn/powerlevel9k.git - $ echo 'source powerlevel9k/powerlevel9k.zsh-theme' >> ~/.zshrc - -##### Option 2: Install for Oh-My-ZSH - -To install this theme for -[Oh-My-Zsh](https://github.com/robbyrussell/oh-my-zsh), clone this repository -into your OMZ `custom/themes` directory. - - $ cd ~/.oh-my-zsh/custom - $ git clone https://github.com/bhilburn/powerlevel9k.git themes/powerlevel9k - -You then need to select this theme in your `~/.zshrc`: - - ZSH_THEME="powerlevel9k/powerlevel9k" - -##### Option 3: Install for Prezto - -To install this theme for use in Prezto, clone this repository into your -[Prezto](https://github.com/sorin-ionescu/prezto) `prompt/external` directory. - - $ cd ~.zprezto/modules/prompt/external - $ git clone https://github.com/bhilburn/powerlevel9k.git - $ ln -s powerlevel9k/powerlevel9k.zsh-theme ../functions/prompt_powerlevel9k_setup - -You then need to select this theme in your `~/.zpreztorc`: - - zstyle ':prezto:module:prompt' theme 'powerlevel9k' - -##### Option 4: Install for antigen - -If you prefer [antigen](https://github.com/zsh-users/antigen), just add this -theme to the antigen config in your `~/.zshrc`: - - $ echo 'antigen theme bhilburn/powerlevel9k powerlevel9k' >> ~/.zshrc - $ echo 'antigen apply' >> ~/.zshrc - -Note that you should define any customizations before calling `antigen theme` -(i.e. setting the `POWERLEVEL9K_*` variables) in your `.zshrc`. - -#### Step 2: Install Powerline Fonts -Technically, you don't *have* to install Powerline fonts. If you are using -a font that has some of the basic glyphs we need, you can use the theme in -`compatible` mode - see the third option, below. - -To get the most out of theme, though, you'll want Powerline-patched fonts. There -are two varieties of these: 'Powerline Fonts' and 'Awesome Powerline -Fonts'. The latter includes additional glyphs that aren't required for a normal -install. - -Do one of the following: - -##### Option 1: Install Powerline Fonts - -You can find the [installation instructions for Powerline Fonts here] -(https://powerline.readthedocs.org/en/latest/installation/linux.html#fonts-installation). -You can also find the raw font files [in this Github -repository](https://github.com/powerline/fonts) if you want to manually install -them for your OS. - -After you have installed Powerline fonts, make the default font in your terminal -emulator the Powerline font you want to use. - -This is the default mode for `Powerlevel9k`, and no further configuration is -necessary. - -**N.B.:** If Powerlevel9k is not working properly, it is almost always the case -that the fonts were not properly installed, or you have not configured your -terminal to use a Powerline-patched font! - -##### Option 2: Install Awesome Powerline Fonts - -Alternatively, you can install [Awesome Powerline -Fonts](https://github.com/gabrielelana/awesome-terminal-fonts), which provide -a number of additional glyphs. - -You then need to indicate that you wish to use the additional glyphs by defining -the following in your `~/.zshrc`: - - POWERLEVEL9K_MODE='awesome-fontconfig' - -If you chose to use already patched fonts, use instead : - - POWERLEVEL9K_MODE='awesome-patched' - +settings, but there are plenty of segment customization options available if you +are interested. -If you choose to make use of this, your prompt will look something like this: +### Customization -![](https://cloud.githubusercontent.com/assets/1544760/7959660/67612918-09fb-11e5-9ef2-2308363c3c51.png) - -Note that if you prefer flat segment transitions, you can use the following with -`Awesome Powerline Fonts` installed: - - POWERLEVEL9K_MODE='flat' - -Which looks like this: - -![](https://cloud.githubusercontent.com/assets/1544760/7981324/76d0eb5a-0aae-11e5-9608-d662123d0b0a.png) - -##### Option 3: Compatible Mode - -This option is best if you prefer not to install additional fonts. This option -will work out-of-the-box if your your terminal font supports the segment -separator characters `\uE0B0` (left segment separator) and `\uE0B2` (right -segment separator). - -All you need to do to in this case is install the `Powerlevel9k` theme itself, -as explained above, and then define the following in your `~/.zshrc`: - - POWERLEVEL9K_MODE='compatible' - -Note that depending on your terminal font, this may still not render -appropriately. This configuration should be used as a back-up. +#### Customizing Prompt Segments +Customizing your prompt is easy! Select the segments you want to have displayed, +and then assign them to either the left or right prompt by adding the following +variables to your `~/.zshrc`. If you don't customize this, the below +configuration is the default: -### Segment Customization + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) + POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time) -Customizing your prompt is easy! Select the segments you want to have displayed, -and then assign them to either the left or right prompt. The segments that are -currently available are: +#### Available Prompt Segments +The segments that are currently available are: * **aws** - The current AWS profile, if active (more info below) * **context** - Your username and host (more info below) @@ -255,13 +136,8 @@ currently available are: * **virtualenv** - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). * **vcs** - Information about this `git` or `hg` repository (if you are in one). -To specify which segments you want, just add the following variables to your -`~/.zshrc`. If you don't customize this, the below configuration is the default: - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time) - -#### The AWS Profile Segment +##### aws If you would like to display the [current AWS profile](http://docs.aws.amazon.com/cli/latest/userguide/installing.html), add @@ -270,7 +146,7 @@ your `~/.zshrc`: export AWS_DEFAULT_PROFILE= -#### The 'context' Segment +##### context The `context` segment (user@host string) is conditional. This lets you enable it, but only display it if you are not your normal user or on a remote host (basically, only print it @@ -281,7 +157,7 @@ elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`: export DEFAULT_USER= -#### The 'dir' segment +##### dir The `dir` segment shows the current working directory. You can limit the output to a certain length: @@ -301,7 +177,7 @@ In each case you have to specify the length you want to shorten the directory to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. -#### The 'ip' segment +##### ip This segment shows you your current internal IP address. It tries to examine all currently used network interfaces and prints the first address it finds. @@ -310,7 +186,24 @@ network interface by setting: POWERLEVEL9K_IP_INTERFACE="eth0" -#### The 'time' segment +##### rspec_tests + +See [Unit Test Ratios](#unit-test-ratios), below. + +##### status + +This segment shows the return code of the last command, and the presence of any +background jobs. By default, this segment will always print, but you can +customize it to only print if there is an error or a forked job by setting the +following variable in your `~/.zshrc`. + + POWERLEVEL9K_STATUS_VERBOSE=false + +##### symphony2_tests + +See [Unit Test Ratios](#unit-test-ratios), below. + +##### time By default the time is show in 'H:M:S' format. If you want to change it, just set another format in your `~/.zshrc`. As an example, this is a reversed @@ -325,43 +218,7 @@ segment, as well: # Output time, date, and a symbol from the "Awesome Powerline Font" set POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S \uE868 %d.%m.%y}" -#### Showing Status - -Usually we display always the status, and in case a command failed, the return -code of the last executed program. In case you want to display the status only -if something special happend, you can set `POWERLEVEL9K_STATUS_VERBOSE=false` -in your `~/.zshrc`. - -#### Unit Test Ratios - -The `symfony2_tests` and `rspec_tests` segments both show a ratio of "real" -classes vs test classes in your source code. This is just a very simple ratio, -and does not show your code coverage or any sophisticated stats. All this does -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. - -#### VI-Mode Indicator - -This Segment shows the current mode of your ZSH. If you want to use your ZSH in -VI-Mode, you need to configure it separatly in your `~/.zshrc`: - - # VI-Mode - # general activation - bindkey -v - - # set some nice hotkeys - bindkey '^P' up-history - bindkey '^N' down-history - bindkey '^?' backward-delete-char - bindkey '^h' backward-delete-char - bindkey '^w' backward-kill-word - bindkey '^r' history-incremental-search-backward - - # make it more responsive - export KEYTIMEOUT=1 - -#### The 'vcs' Segment +##### vcs By default, the `vcs` segment will provide quite a bit of information. If you would also like for it to display the current hash / changeset, simply define @@ -380,7 +237,7 @@ You can also disable the branch icon in your prompt by setting # Hide the branch icon POWERLEVEL9K_HIDE_BRANCH_ICON=true -##### Symbols +**vcs Symbols** The `vcs` segment uses various symbols to tell you the state of your repository. These symbols depend on your installed font and selected `POWERLEVEL9K_MODE` @@ -401,6 +258,36 @@ from the [Installation](#Installation) section above. | None | None | ![icon_git](https://cloud.githubusercontent.com/assets/1544760/7976092/b5909f80-0a76-11e5-9950-1438b9d72465.gif) | Repository is a git repository | None | None | ![icon_mercurial](https://cloud.githubusercontent.com/assets/1544760/7976090/b5908da6-0a76-11e5-8c91-452b6e73f631.gif) | Repository is a Mercurial repository +##### vi_mode + +This Segment shows the current mode of your ZSH. If you want to use your ZSH in +VI-Mode, you need to configure it separately in your `~/.zshrc`: + + # VI-Mode + # general activation + bindkey -v + + # set some nice hotkeys + bindkey '^P' up-history + bindkey '^N' down-history + bindkey '^?' backward-delete-char + bindkey '^h' backward-delete-char + bindkey '^w' backward-kill-word + bindkey '^r' history-incremental-search-backward + + # make it more responsive + export KEYTIMEOUT=1 + +#### Unit Test Ratios + +The `symfony2_tests` and `rspec_tests` segments both show a ratio of "real" +classes vs test classes in your source code. This is just a very simple ratio, +and does not show your code coverage or any sophisticated stats. All this does +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. + + ### Styling You can configure the look and feel of your prompt easily with some built-in @@ -519,63 +406,3 @@ your prompt even further. These Segments are `context`, `vcs`, `rspec_stats`, # symfony2_tests for poor test coverage POWERLEVEL9K_SYMFONY2_TESTS_BAD_FOREGROUND='red' POWERLEVEL9K_SYMFONY2_TESTS_BAD_BACKGROUND='white' - -### Troubleshooting - -Here are some fixes to some common problems. - -#### Gaps Between Segments - -You can see this issue in the screenshot, below: - -![](http://bhilburn.org/content/images/2014/12/font_issue.png) - -Thankfully, this is easy to fix. This happens if you have successfully installed -Powerline fonts, but did not make a Powerline font the default font in your -terminal emulator (e.g., 'terminator', 'gnome-terminal', 'konsole', etc.,). - -#### Segment Colors are Wrong - -If the color display within your terminal seems off, it's possible you are using -a reduced color set. You can check this by invoking `echotc Co` in your -terminal, which should yield `256`. If you see something different, try setting -`xterm-256color` in your `~/.zshrc`: - - TERM=xterm-256color - -#### Strange Characters in prompt - -If your prompt shows strange character like this: - -![](https://cloud.githubusercontent.com/assets/1544760/9156161/e0e584e6-3ed0-11e5-897a-2318a8e32d35.png) - -it is most likely that you set `POWERLEVEL9K_MODE="awesome-patched"`, but -did not install an [awesome-font](https://github.com/gabrielelana/awesome-terminal-fonts). For most other modes, you need a [powerline-patched](https://github.com/powerline/fonts) font. - -### Meta - -#### Kudos - -This theme wouldn't have happened without inspiration from the original -[agnoster](https://github.com/agnoster/agnoster-zsh-theme) ZSH theme. - -Before creating this theme, I also tried [jeremyFreeAgent's -theme](https://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme) and -[maverick2000's theme, ZSH2000](https://github.com/maverick2000/zsh2000). - -#### Developing - -Documentation for developers is kept on the [Powerlevel9k Github -wiki](https://github.com/bhilburn/powerlevel9k/wiki/Developer's-Guide). - -#### Contributions / Bugs / Contact - -If you have any requests or bug reports, please use the tracker in this Github -repository. - -I'm happy to accept code contributions from anyone who has a bug fix, new -feature, or just a general improvement! Please submit your contribution as -a Github pull-request. - -If you would like to contact me directly, you can find my e-mail address on my -[Github profile page](https://github.com/bhilburn). -- cgit v1.2.3 From a4096b4c0610c21060aef68dfceee14ec758cdd9 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:22:05 -0700 Subject: README: Creating links for each segment section --- README.md | 78 +++++++++++++++------------------------------------------------ 1 file changed, 18 insertions(+), 60 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index b56df188..0ff1f739 100644 --- a/README.md +++ b/README.md @@ -22,48 +22,6 @@ this theme focus on four primary goals: 4. Optimize the code for execution speed as much as possible. A snappy terminal is a happy terminal. - - -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - -- [Features](#features) -- [Installation](#installation) - - [Step 1: Install Powerlevel9k](#step-1-install-powerlevel9k) - - [Option 1: Install for Vanilla ZSH](#option-1-install-for-vanilla-zsh) - - [Option 2: Install for Oh-My-ZSH](#option-2-install-for-oh-my-zsh) - - [Option 3: Install for Prezto](#option-3-install-for-prezto) - - [Option 4: Install for antigen](#option-4-install-for-antigen) - - [Step 2: Install Powerline Fonts](#step-2-install-powerline-fonts) - - [Option 1: Install Powerline Fonts](#option-1-install-powerline-fonts) - - [Option 2: Install Awesome Powerline Fonts](#option-2-install-awesome-powerline-fonts) - - [Option 3: Compatible Mode](#option-3-compatible-mode) -- [Segment Customization](#segment-customization) - - [The AWS Profile Segment](#the-aws-profile-segment) - - [The 'context' Segment](#the-context-segment) - - [The 'dir' segment](#the-dir-segment) - - [The 'ip' segment](#the-ip-segment) - - [The 'time' segment](#the-time-segment) - - [Unit Test Ratios](#unit-test-ratios) - - [The 'vcs' Segment](#the-vcs-segment) - - [Symbols](#symbols) -- [Styling](#styling) - - [Double-Lined Prompt](#double-lined-prompt) - - [Disable Right Prompt](#disable-right-prompt) - - [Light Color Theme](#light-color-theme) - - [Icon Customization](#icon-customization) - - [Segment Color Customization](#segment-color-customization) - - [Special Segment Colors](#special-segment-colors) -- [Troubleshooting](#troubleshooting) - - [Gaps Between Segments](#gaps-between-segments) - - [Segment Colors are Wrong](#segment-colors-are-wrong) - - [Strange Characters in prompt](#strange-characters-in-prompt) -- [Meta](#meta) - - [Kudos](#kudos) - - [Developing](#developing) - - [Contributions / Bugs / Contact](#contributions--bugs--contact) - - - ### Features * Supports `git` and `mercurial` repo information through ZSH's `VCS_INFO`: @@ -117,24 +75,24 @@ configuration is the default: #### Available Prompt Segments The segments that are currently available are: -* **aws** - The current AWS profile, if active (more info below) -* **context** - Your username and host (more info below) -* **dir** - Your current working directory. -* **history** - The command number for the current line. -* **ip** - Shows the current IP address. -* **load** - Your machines 5 minute load average and free RAM. -* **node_version** - Show the version number of the installed Node.js. -* **os_icon** - Display a nice little icon, depending on your operating system. -* **php_version** - Show the current PHP version. -* **rbenv** - Ruby environment information (if one is active). -* **rspec_stats** - Show a ratio of test classes vs code classes for RSpec. -* **status** - The return code of the previous command, and status of background jobs. -* **symfony2_tests** - Show a ratio of test classes vs code classes for Symfony2. -* **symfony2_version** - Show the current Symfony2 version, if you are in a Symfony2-Project dir. -* **time** - System time. -* **vi_mode** - Vi editing mode (NORMAL|INSERT). -* **virtualenv** - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). -* **vcs** - Information about this `git` or `hg` repository (if you are in one). +* [aws](#aws) - The current AWS profile, if active. +* [context](#context) - Your username and host. +* [dir](#dir) - Your current working directory. +* [history](#history) - The command number for the current line. +* [ip](#ip) - Shows the current IP address. +* [load](#load) - Your machines 5 minute load average and free RAM. +* [node_version](#node_version) - Show the version number of the installed Node.js. +* [os_icon](#os_icon) - Display a nice little icon, depending on your operating system. +* [php_version](#php_version) - Show the current PHP version. +* [rbenv](#rbenv) - Ruby environment information (if one is active). +* [rspec_stats](#rspec_stats) - Show a ratio of test classes vs code classes for RSpec. +* [status](#status) - The return code of the previous command, and status of background jobs. +* [symphony2_tests](#symphony2_tests) - Show a ratio of test classes vs code classes for Symfony2. +* [symphony2_version](#symphony2_version)- Show the current Symfony2 version, if you are in a Symfony2-Project dir. +* [time](#time) - System time. +* [vi_mode](#vi_mode)- Vi editing mode (NORMAL|INSERT). +* [virtualenv](#virtualenv) - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). +* [vcs](#vcs) - Information about this `git` or `hg` repository (if you are in one). ##### aws -- cgit v1.2.3 From cdaa2c830bb5cc5c6f28e6dc75c9ad690a56b806 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:26:04 -0700 Subject: README: Fixing some segment links --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 0ff1f739..7add1dc9 100644 --- a/README.md +++ b/README.md @@ -78,20 +78,20 @@ The segments that are currently available are: * [aws](#aws) - The current AWS profile, if active. * [context](#context) - Your username and host. * [dir](#dir) - Your current working directory. -* [history](#history) - The command number for the current line. +* history - The command number for the current line. * [ip](#ip) - Shows the current IP address. -* [load](#load) - Your machines 5 minute load average and free RAM. -* [node_version](#node_version) - Show the version number of the installed Node.js. -* [os_icon](#os_icon) - Display a nice little icon, depending on your operating system. -* [php_version](#php_version) - Show the current PHP version. +* load - Your machines 5 minute load average and free RAM. +* node_version - Show the version number of the installed Node.js. +* os_icon - Display a nice little icon, depending on your operating system. +* php_version - Show the current PHP version. * [rbenv](#rbenv) - Ruby environment information (if one is active). * [rspec_stats](#rspec_stats) - Show a ratio of test classes vs code classes for RSpec. * [status](#status) - The return code of the previous command, and status of background jobs. * [symphony2_tests](#symphony2_tests) - Show a ratio of test classes vs code classes for Symfony2. -* [symphony2_version](#symphony2_version)- Show the current Symfony2 version, if you are in a Symfony2-Project dir. +* symphony2_version - Show the current Symfony2 version, if you are in a Symfony2-Project dir. * [time](#time) - System time. * [vi_mode](#vi_mode)- Vi editing mode (NORMAL|INSERT). -* [virtualenv](#virtualenv) - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). +* virtualenv - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). * [vcs](#vcs) - Information about this `git` or `hg` repository (if you are in one). @@ -144,7 +144,7 @@ network interface by setting: POWERLEVEL9K_IP_INTERFACE="eth0" -##### rspec_tests +##### rspec_stats See [Unit Test Ratios](#unit-test-ratios), below. @@ -238,7 +238,7 @@ VI-Mode, you need to configure it separately in your `~/.zshrc`: #### Unit Test Ratios -The `symfony2_tests` and `rspec_tests` segments both show a ratio of "real" +The `symfony2_tests` and `rspec_stats` segments both show a ratio of "real" classes vs test classes in your source code. This is just a very simple ratio, and does not show your code coverage or any sophisticated stats. All this does is count your source files and test files, and calculate the ratio between them. -- cgit v1.2.3 From b3c7fdf410f14cdbd828712ae325e1e895245e98 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:28:53 -0700 Subject: README: cleanup --- README.md | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7add1dc9..96e62ebc 100644 --- a/README.md +++ b/README.md @@ -22,28 +22,6 @@ this theme focus on four primary goals: 4. Optimize the code for execution speed as much as possible. A snappy terminal is a happy terminal. -### Features - -* Supports `git` and `mercurial` repo information through ZSH's `VCS_INFO`: - * branch / tag name - * current action status (rebasing, merging, etc.,) - * being behind / ahead of your remote by some number of commits - * number of stashes (git only) - * conditionally shows remote tracking branch if the name differs from local - * current active bookmark (mercurial only) - * various working tree statuses (e.g., unstaged, staged, etc.,) -* Shows return-code of the last command if it is an error code -* Indicates background jobs with a gear icon -* Can conditionally display the `user@host` string when needed (e.g., SSH) -* Provides segment for command history (so you can `$ !` to re-run) -* Plenty of additional segments to choose from (e.g., AWS, ruby) -* Can be used as a single or double-lined prompt (see screenshots below) -* Several built-in color configurations to choose from - -**If you would like an OMZ theme that provides some of the same features but -doesn't require Powerline fonts, check out the sister font, -[hackersaurus](https://github.com/bhilburn/hackersaurus).** - Here is a detailed screenshot showing `powerlevel9k` with default settings and varying terminal status indicators: @@ -78,20 +56,20 @@ The segments that are currently available are: * [aws](#aws) - The current AWS profile, if active. * [context](#context) - Your username and host. * [dir](#dir) - Your current working directory. -* history - The command number for the current line. +* **history** - The command number for the current line. * [ip](#ip) - Shows the current IP address. -* load - Your machines 5 minute load average and free RAM. -* node_version - Show the version number of the installed Node.js. -* os_icon - Display a nice little icon, depending on your operating system. -* php_version - Show the current PHP version. +* **load** - Your machines 5 minute load average and free RAM. +* **node_version** - Show the version number of the installed Node.js. +* **os_icon** - Display a nice little icon, depending on your operating system. +* **php_version** - Show the current PHP version. * [rbenv](#rbenv) - Ruby environment information (if one is active). * [rspec_stats](#rspec_stats) - Show a ratio of test classes vs code classes for RSpec. * [status](#status) - The return code of the previous command, and status of background jobs. * [symphony2_tests](#symphony2_tests) - Show a ratio of test classes vs code classes for Symfony2. -* symphony2_version - Show the current Symfony2 version, if you are in a Symfony2-Project dir. +* **symphony2_version** - Show the current Symfony2 version, if you are in a Symfony2-Project dir. * [time](#time) - System time. * [vi_mode](#vi_mode)- Vi editing mode (NORMAL|INSERT). -* virtualenv - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). +* **virtualenv** - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). * [vcs](#vcs) - Information about this `git` or `hg` repository (if you are in one). -- cgit v1.2.3 From 49427538d7dd82a98427056d8a5f46aadf0ac276 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:31:14 -0700 Subject: README: Fixing install instruction bullets --- README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'README.md') diff --git a/README.md b/README.md index 96e62ebc..14cffab5 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ There are two installation steps to go from a lame terminal to a "Power Level 9000" terminal. Once you are done, you can optionally customize your prompt. [Installation Instructions](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions) + 1. [Install the Powerlevel9k Theme](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-1-install-powerlevel9k) 2. [Install Powerline-Patched Fonts](https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#step-2-install-powerline-fonts) -- cgit v1.2.3 From d592e047d311ac64119588222084f688b9b0cfb1 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:34:44 -0700 Subject: README: Adding ToC --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 14cffab5..279de81a 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,12 @@ varying terminal status indicators: ![](http://bhilburn.org/content/images/2014/12/powerlevel9k.png) +### Table of Contents + +1. (Installation)[#installation] +2. (Customization)[#customization] +3. (Styling)[#styling] + ### Installation There are two installation steps to go from a lame terminal to a "Power Level 9000" terminal. Once you are done, you can optionally customize your prompt. -- cgit v1.2.3 From b6d1cd109e0ce3f706ebbdacd5a306e3f91d8297 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:35:22 -0700 Subject: README: I'm good at markdown --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 279de81a..2871e744 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ varying terminal status indicators: ### Table of Contents -1. (Installation)[#installation] -2. (Customization)[#customization] -3. (Styling)[#styling] +1. [Installation](#installation) +2. [Customization](#customization) +3. [Styling](#styling) ### Installation There are two installation steps to go from a lame terminal to a "Power Level -- cgit v1.2.3 From 625b584ddd1d37b2cd42167e8f468e4040e081bb Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:49:12 -0700 Subject: README: Moving styling to the wiki --- README.md | 129 ++++---------------------------------------------------------- 1 file changed, 8 insertions(+), 121 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2871e744..b6a67797 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,8 @@ varying terminal status indicators: 1. [Installation](#installation) 2. [Customization](#customization) -3. [Styling](#styling) +3. [Stylizing](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) +4. [Troubleshooting](https://github.com/bhilburn/powerlevel9k/wiki/Troubleshooting) ### Installation There are two installation steps to go from a lame terminal to a "Power Level @@ -48,6 +49,12 @@ are interested. ### Customization +#### Customizing Your Prompt +Be sure to check out the wiki page on the additional prompt customization +options, including color and icon settings: + +[Stylizing Your Prompt](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) + #### Customizing Prompt Segments Customizing your prompt is easy! Select the segments you want to have displayed, and then assign them to either the left or right prompt by adding the following @@ -229,123 +236,3 @@ and does not show your code coverage or any sophisticated stats. All this does 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. - - -### Styling - -You can configure the look and feel of your prompt easily with some built-in -options. - -#### Double-Lined Prompt - -By default, `powerlevel9k` is a single-lined prompt. If you would like to have -the segments display on one line, and print the command prompt below it, simply -define `POWERLEVEL9K_PROMPT_ON_NEWLINE` in your `~/.zshrc`: - - POWERLEVEL9K_PROMPT_ON_NEWLINE=true - -Here is what it looks like: - -![](http://bhilburn.org/content/images/2015/03/double-line.png) - -You can customize the icons used to draw the multiline prompt by setting the -following variables in your `~/.zshrc`: - - POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="↱" - POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX="↳ " - -#### Disable Right Prompt - -If you do not want a right prompt, you can disable it by setting: - - POWERLEVEL9K_DISABLE_RPROMPT=true - -#### Light Color Theme - -If you prefer to use "light" colors, simply set `POWERLEVEL9K_COLOR_SCHEME` -to `light` in your `~/.zshrc`, and you're all set! - - POWERLEVEL9K_COLOR_SCHEME='light' - -The 'light' color scheme works well for ['Solarized -Light'](https://github.com/altercation/solarized) users. Check it out: - -![](http://bhilburn.org/content/images/2015/03/solarized-light.png) - -#### Icon Customization - -Each icon used can be customized too by specifying a variable named like -the icon and prefixed with 'POWERLEVEL9K'. If you want to use another icon -as segment separators, you can easily do that: - - POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=$'\uE0B1' - POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=$'\uE0B3' - -You could get a list of all icons defined in random colors, by adding the -special segment `icons_test` to your prompt: - - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(icons_test) - -This special prompt does not work on the right side, as it would be too long, -and ZSH hides it automatically. Also have in mind, that the output depends on -your `POWERLEVEL9K_MODE` settings. - -You can change any icon by setting a environment variable. To get a full list -of icons just type `get_icon_names` in your terminal. - -#### Segment Color Customization - -For each segment in your prompt, you can specify a foreground and background -color by setting them in your `~/.zshrc`. Use the segment names from the above -section `Segment Customization`. For example, to change the appearance of the -`time` segment, you would use: - - POWERLEVEL9K_TIME_FOREGROUND='red' - POWERLEVEL9K_TIME_BACKGROUND='blue' - -Note that you can also use a colorcode value. Example: - - POWERLEVEL9K_VCS_FOREGROUND='021' # Dark blue - -For a full list of supported colors, run the `spectrum_ls` program in your -terminal. - -#### Special Segment Colors - -Some segments have additional color options if you want to customize the look of -your prompt even further. These Segments are `context`, `vcs`, `rspec_stats`, -`symfony2_tests`: - - # Customizing `context` colors for root and non-root users - POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND="green" - POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="cyan" - POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND="red" - POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND="blue" - - # Advanced `vcs` color customization - POWERLEVEL9K_VCS_FOREGROUND='blue' - POWERLEVEL9K_VCS_DARK_FOREGROUND='black' - POWERLEVEL9K_VCS_BACKGROUND='green' - # If VCS changes are detected: - POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='red' - POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='cyan' - - # rspec_stats for good test coverage - POWERLEVEL9K_RSPEC_STATS_GOOD_FOREGROUND='blue' - POWERLEVEL9K_RSPEC_STATS_GOOD_BACKGROUND='green' - # rspec_stats for average test coverage - POWERLEVEL9K_RSPEC_STATS_AVG_FOREGROUND='black' - POWERLEVEL9K_RSPEC_STATS_AVG_BACKGROUND='cyan' - # rspec_stats for poor test coverage - POWERLEVEL9K_RSPEC_STATS_BAD_FOREGROUND='red' - POWERLEVEL9K_RSPEC_STATS_BAD_BACKGROUND='white' - - # symfony2_tests for good test coverage - POWERLEVEL9K_SYMFONY2_TESTS_GOOD_FOREGROUND='blue' - POWERLEVEL9K_SYMFONY2_TESTS_GOOD_BACKGROUND='green' - # symfony2_tests for average test coverage - POWERLEVEL9K_SYMFONY2_TESTS_AVG_FOREGROUND='black' - POWERLEVEL9K_SYMFONY2_TESTS_AVG_BACKGROUND='cyan' - # symfony2_tests for poor test coverage - POWERLEVEL9K_SYMFONY2_TESTS_BAD_FOREGROUND='red' - POWERLEVEL9K_SYMFONY2_TESTS_BAD_BACKGROUND='white' -- cgit v1.2.3 From 5714581e1306a2f165af24364beb99ba279ae5de Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:53:17 -0700 Subject: README: Final cleanup --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index b6a67797..04b34087 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ Look like a bad-ass. Impress everyone in 'Screenshot Your Desktop' threads. Use ![](http://bhilburn.org/content/images/2015/01/pl9k-improved.png) +You can check out some other users' configurations in our wiki: [Show Off Your +Config](https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config). + There are a number of Powerline ZSH themes available, now. The developers of this theme focus on four primary goals: @@ -22,8 +25,7 @@ this theme focus on four primary goals: 4. Optimize the code for execution speed as much as possible. A snappy terminal is a happy terminal. -Here is a detailed screenshot showing `powerlevel9k` with default settings and -varying terminal status indicators: +Here is a detailed screenshot showing `powerlevel9k` in action, with default settings. ![](http://bhilburn.org/content/images/2014/12/powerlevel9k.png) @@ -51,9 +53,7 @@ are interested. #### Customizing Your Prompt Be sure to check out the wiki page on the additional prompt customization -options, including color and icon settings: - -[Stylizing Your Prompt](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) +options, including color and icon settings: [Stylizing Your Prompt](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) #### Customizing Prompt Segments Customizing your prompt is easy! Select the segments you want to have displayed, -- cgit v1.2.3 From 0b6b6de8e108a0465f6c42b7c3992e3c2cbb19bb Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:57:18 -0700 Subject: README: Cleaning up ToC --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 04b34087..412aabae 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,11 @@ Here is a detailed screenshot showing `powerlevel9k` in action, with default set ### Table of Contents 1. [Installation](#installation) -2. [Customization](#customization) -3. [Stylizing](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) -4. [Troubleshooting](https://github.com/bhilburn/powerlevel9k/wiki/Troubleshooting) +2. [Customization](#prompt-customization) + 1. [Stylizing Your Prompt](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) + 2. [Customizing Prompt Segments](#customizing-prompt-segments) + 3. [Available Prompt Segments](#available-prompt-segments) +3. [Troubleshooting](https://github.com/bhilburn/powerlevel9k/wiki/Troubleshooting) ### Installation There are two installation steps to go from a lame terminal to a "Power Level @@ -49,9 +51,8 @@ No configuration is necessary post-installation if you like the default settings, but there are plenty of segment customization options available if you are interested. -### Customization +### Prompt Customization -#### Customizing Your Prompt Be sure to check out the wiki page on the additional prompt customization options, including color and icon settings: [Stylizing Your Prompt](https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt) -- cgit v1.2.3 From 9d8ab6f6677b6829a87939d770b45624470cc77c Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 14:58:51 -0700 Subject: README: Add link to Wiki at end of README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 412aabae..c6d7bd1c 100644 --- a/README.md +++ b/README.md @@ -237,3 +237,9 @@ and does not show your code coverage or any sophisticated stats. All this does 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. + +### Other + +Looking for more information? We put a lot of stuff in our Wiki! + +[Head to the Wiki](https://github.com/bhilburn/powerlevel9k/wiki) -- cgit v1.2.3 From 941379d71c7a11c1de042bc8cd4ef5b7ccc6a17c Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 12 Oct 2015 15:00:17 -0700 Subject: README: one more wiki link to ToC --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index c6d7bd1c..4baf0629 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Here is a detailed screenshot showing `powerlevel9k` in action, with default set 3. [Available Prompt Segments](#available-prompt-segments) 3. [Troubleshooting](https://github.com/bhilburn/powerlevel9k/wiki/Troubleshooting) +Be sure to also [check out the Wiki](https://github.com/bhilburn/powerlevel9k/wiki)! + ### Installation There are two installation steps to go from a lame terminal to a "Power Level 9000" terminal. Once you are done, you can optionally customize your prompt. -- cgit v1.2.3 From d5ffa502e26b574577f523e22476f23ec4567083 Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Tue, 13 Oct 2015 19:17:08 -0400 Subject: Add note about NVM to the readme --- README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'README.md') diff --git a/README.md b/README.md index 4baf0629..281f5b5a 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ The segments that are currently available are: * [ip](#ip) - Shows the current IP address. * **load** - Your machines 5 minute load average and free RAM. * **node_version** - Show the version number of the installed Node.js. +* **nvm** - Show the version of Node that is currently active, if it differs from the version used by NVM * **os_icon** - Display a nice little icon, depending on your operating system. * **php_version** - Show the current PHP version. * [rbenv](#rbenv) - Ruby environment information (if one is active). -- cgit v1.2.3 From 86b460f06bfb01f782026af806c2dc68f8925621 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Fri, 16 Oct 2015 20:16:31 +0200 Subject: vi_mode segement more customizable. --- README.md | 6 ++++++ powerlevel9k.zsh-theme | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4baf0629..c5ef1afe 100644 --- a/README.md +++ b/README.md @@ -231,6 +231,12 @@ VI-Mode, you need to configure it separately in your `~/.zshrc`: # make it more responsive export KEYTIMEOUT=1 +If you want to display another string than "NORMAL" or "INSERT" in command or +insert-mode, you can do that by setting environment variables like: + + POWERLEVEL9K_VI_INSERT_MODE_STRING="INS" + POWERLEVEL9K_VI_COMMAND_MODE_STRING="CMD" + #### Unit Test Ratios The `symfony2_tests` and `rspec_stats` segments both show a ratio of "real" diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index c2ee2625..0af9f56d 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -850,13 +850,15 @@ prompt_time() { } # Vi Mode: show editing mode (NORMAL|INSERT) +set_default POWERLEVEL9K_VI_INSERT_MODE_STRING "INSERT" +set_default POWERLEVEL9K_VI_COMMAND_MODE_STRING "NORMAL" prompt_vi_mode() { case ${KEYMAP} in main|viins) - "$1_prompt_segment" "$0_INSERT" "$DEFAULT_COLOR" "blue" "INSERT" + "$1_prompt_segment" "$0_INSERT" "$DEFAULT_COLOR" "blue" "$POWERLEVEL9K_VI_INSERT_MODE_STRING" ;; vicmd) - "$1_prompt_segment" "$0_NORMAL" "$DEFAULT_COLOR" "default" "NORMAL" + "$1_prompt_segment" "$0_NORMAL" "$DEFAULT_COLOR" "default" "$POWERLEVEL9K_VI_COMMAND_MODE_STRING" ;; esac } -- cgit v1.2.3 From 5add0daad027fab254a7c2a322e636dd7dc982d2 Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Sat, 17 Oct 2015 11:30:55 -0700 Subject: added prompt segment for todo.txt task number --- README.md | 3 ++- powerlevel9k.zsh-theme | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4baf0629..4c5e6809 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ The segments that are currently available are: * [symphony2_tests](#symphony2_tests) - Show a ratio of test classes vs code classes for Symfony2. * **symphony2_version** - Show the current Symfony2 version, if you are in a Symfony2-Project dir. * [time](#time) - System time. +* [todo.txt](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file. * [vi_mode](#vi_mode)- Vi editing mode (NORMAL|INSERT). * **virtualenv** - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). * [vcs](#vcs) - Information about this `git` or `hg` repository (if you are in one). @@ -127,7 +128,7 @@ To change the way how the current working directory is truncated, just set: # default behaviour is to truncate whole directories In each case you have to specify the length you want to shorten the directory -to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in +to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. ##### ip diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index c2ee2625..0fe32d9d 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -45,6 +45,7 @@ case $POWERLEVEL9K_MODE in AWS_ICON $'\UE895' #  BACKGROUND_JOBS_ICON $'\UE82F ' #  TEST_ICON $'\UE891' #  + TODO_ICON $'\U2611' # ☑ OK_ICON $'\U2713' # ✓ FAIL_ICON $'\U2718' # ✘ SYMFONY_ICON 'SF' @@ -93,6 +94,7 @@ case $POWERLEVEL9K_MODE in AWS_ICON $'\UF296' #  BACKGROUND_JOBS_ICON $'\UF013 ' #  TEST_ICON $'\UF291' #  + TODO_ICON $'\U2611' # ☑ OK_ICON $'\UF23A' #  FAIL_ICON $'\UF281' #  SYMFONY_ICON 'SF' @@ -136,6 +138,7 @@ case $POWERLEVEL9K_MODE in AWS_ICON 'AWS:' BACKGROUND_JOBS_ICON $'\u2699' # ⚙ TEST_ICON '' + TODO_ICON $'\U2611' # ☑ OK_ICON $'\u2713' # ✓ FAIL_ICON $'\u2718' # ✘ SYMFONY_ICON 'SF' @@ -849,6 +852,16 @@ prompt_time() { "$1_prompt_segment" "$0" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$time_format" } +# todo.sh: shows the number of tasks in your todo.sh file +prompt_todo() { + if $(hash todo.sh 2>&-); then + count=$(todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }') + if [[ "$count" = <-> ]]; then + "$1_prompt_segment" "$0" "244" "$DEFAULT_COLOR" "$(print_icon 'TODO_ICON') $count" + fi + fi +} + # Vi Mode: show editing mode (NORMAL|INSERT) prompt_vi_mode() { case ${KEYMAP} in -- cgit v1.2.3 From 2a6be9dc40562d4c085593e42055ceda90ff6bcb Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Sat, 17 Oct 2015 11:32:59 -0700 Subject: reverting unnoticed white space change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4c5e6809..8252f6e5 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ To change the way how the current working directory is truncated, just set: # default behaviour is to truncate whole directories In each case you have to specify the length you want to shorten the directory -to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in +to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. ##### ip -- cgit v1.2.3 From 95d8b62e656e6ccf8c2e6b42e9876c9bc4ba4bfd Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sat, 17 Oct 2015 20:08:22 -0700 Subject: README: changing name of `todo.txt` segment to `todo` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 8252f6e5..b8a2b628 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ The segments that are currently available are: * [symphony2_tests](#symphony2_tests) - Show a ratio of test classes vs code classes for Symfony2. * **symphony2_version** - Show the current Symfony2 version, if you are in a Symfony2-Project dir. * [time](#time) - System time. -* [todo.txt](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file. +* [todo](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file. * [vi_mode](#vi_mode)- Vi editing mode (NORMAL|INSERT). * **virtualenv** - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). * [vcs](#vcs) - Information about this `git` or `hg` repository (if you are in one). -- cgit v1.2.3 From ee8c59806edd8333608e223fd4b1ff38ecf81de9 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sat, 17 Oct 2015 20:29:07 -0700 Subject: README: Updating the docs about `vi_mode` segment. --- README.md | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e5c506ae..220a6298 100644 --- a/README.md +++ b/README.md @@ -215,29 +215,17 @@ from the [Installation](#Installation) section above. ##### vi_mode -This Segment shows the current mode of your ZSH. If you want to use your ZSH in -VI-Mode, you need to configure it separately in your `~/.zshrc`: +This segment shows ZSH's current input mode. Note that this is only useful if +you are using the [ZSH Line Editor](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html) +(VI mode). You can enable this either by `.zshrc` configuration or using a plugin, like +[Oh-My-Zsh's vi-mode plugin](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/vi-mode/vi-mode.plugin.zsh). - # VI-Mode - # general activation - bindkey -v +If you want to display a string other than "NORMAL" or "INSERT" in `command` and +`insert-mode`, you can do so by setting the following variables in your +`~/.zshrc`: - # set some nice hotkeys - bindkey '^P' up-history - bindkey '^N' down-history - bindkey '^?' backward-delete-char - bindkey '^h' backward-delete-char - bindkey '^w' backward-kill-word - bindkey '^r' history-incremental-search-backward - - # make it more responsive - export KEYTIMEOUT=1 - -If you want to display another string than "NORMAL" or "INSERT" in command or -insert-mode, you can do that by setting environment variables like: - - POWERLEVEL9K_VI_INSERT_MODE_STRING="INS" - POWERLEVEL9K_VI_COMMAND_MODE_STRING="CMD" + POWERLEVEL9K_VI_INSERT_MODE_STRING="INSERT" + POWERLEVEL9K_VI_COMMAND_MODE_STRING="NORMAL" #### Unit Test Ratios -- cgit v1.2.3 From 38bccd1340389a26b75e92878bf61d6753df4462 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sat, 17 Oct 2015 21:45:00 -0700 Subject: README: Updating second image to use @natemccurdy awesome gif. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 4baf0629..c445b62c 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ this theme focus on four primary goals: 4. Optimize the code for execution speed as much as possible. A snappy terminal is a happy terminal. -Here is a detailed screenshot showing `powerlevel9k` in action, with default settings. +Here is `powerlevel9k` in action, with [some simple settings](https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config#natemccurdys-configuration). -![](http://bhilburn.org/content/images/2014/12/powerlevel9k.png) +![](https://camo.githubusercontent.com/80ec23fda88d2f445906a3502690f22827336736/687474703a2f2f692e696d6775722e636f6d2f777942565a51792e676966) ### Table of Contents -- cgit v1.2.3 From acf5e97756a97c0feb12c38475266b0c079ca25f Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Sun, 18 Oct 2015 10:55:37 -0700 Subject: added battery prompt segment usable on OS X systems --- README.md | 17 +++++++++++++++++ powerlevel9k.zsh-theme | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index a06b4857..ac397e65 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ configuration is the default: The segments that are currently available are: * [aws](#aws) - The current AWS profile, if active. +* [battery](#battery) - Current battery status(OS X only). * [context](#context) - Your username and host. * [dir](#dir) - Your current working directory. * **history** - The command number for the current line. @@ -101,6 +102,22 @@ your `~/.zshrc`: export AWS_DEFAULT_PROFILE= +##### battery + +This segment will display your current battery status on an OS X system(fails gracefully +on systems without a battery and non OS X systems). It can be customized in your .zshrc +with the environment variables detailed below with their default values. + + POWERLEVEL9K_BATTERY_CHARGING="yellow" + POWERLEVEL9K_BATTERY_CHARGED="green" + POWERLEVEL9K_BATTERY_DISCONNECTED=$DEFAULT_COLOR + POWERLEVEL9K_BATTERY_LOW_THRESHOLD=10 + POWERLEVEL9K_BATTERY_LOW_COLOR="red" + +In addition to the above it supports standard _FOREGROUND value without affecting the icon color + + + ##### context The `context` segment (user@host string) is conditional. This lets you enable it, but only display diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 7063962f..6dd4f8da 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -46,6 +46,7 @@ case $POWERLEVEL9K_MODE in BACKGROUND_JOBS_ICON $'\UE82F ' #  TEST_ICON $'\UE891' #  TODO_ICON $'\U2611' # ☑ + BATTERY_ICON $'\UE894' #  OK_ICON $'\U2713' # ✓ FAIL_ICON $'\U2718' # ✘ SYMFONY_ICON 'SF' @@ -95,6 +96,7 @@ case $POWERLEVEL9K_MODE in BACKGROUND_JOBS_ICON $'\UF013 ' #  TEST_ICON $'\UF291' #  TODO_ICON $'\U2611' # ☑ + BATTERY_ICON $'\u1F50B' # 🔋 OK_ICON $'\UF23A' #  FAIL_ICON $'\UF281' #  SYMFONY_ICON 'SF' @@ -139,6 +141,7 @@ case $POWERLEVEL9K_MODE in BACKGROUND_JOBS_ICON $'\u2699' # ⚙ TEST_ICON '' TODO_ICON $'\U2611' # ☑ + BATTERY_ICON $'\u1F50B' # 🔋 OK_ICON $'\u2713' # ✓ FAIL_ICON $'\u2718' # ✘ SYMFONY_ICON 'SF' @@ -611,6 +614,48 @@ prompt_aws() { fi } +prompt_battery() { + if [[ -f /usr/sbin/ioreg && -x /usr/sbin/ioreg ]]; then + # return if there is no battery on system + [[ -z $(ioreg -n AppleSmartBattery | grep MaxCapacity) ]] && return + + # set default values of not specified in shell + [[ -z $POWERLEVEL9K_BATTERY_CHARGING ]] && POWERLEVEL9K_BATTERY_CHARGING="yellow" + [[ -z $POWERLEVEL9K_BATTERY_CHARGED ]] && POWERLEVEL9K_BATTERY_CHARGED="green" + [[ -z $POWERLEVEL9K_BATTERY_DISCONNECTED ]] && POWERLEVEL9K_BATTERY_DISCONNECTED="$DEFAULT_COLOR" + [[ -z $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && POWERLEVEL9K_BATTERY_LOW_THRESHOLD=10 + [[ -z $POWERLEVEL9K_BATTERY_LOW_COLOR ]] && POWERLEVEL9K_BATTERY_LOW_COLOR="red" + [[ -z $POWERLEVEL9K_BATTERY_FOREGROUND ]] && local fg_color="$DEFAULT_COLOR" || local fg_color=$POWERLEVEL9K_BATTERY_FOREGROUND + + # get charge status + [[ $(ioreg -n AppleSmartBattery | grep ExternalConnected | awk '{ print $5 }') =~ "Yes" ]] && local connected=true + [[ $(ioreg -n AppleSmartBattery | grep IsCharging | awk '{ print $5 }') =~ "Yes" ]] && local charging=true + + # convert time remaining from minutes to hours:minutes date string + local time_remaining=$(ioreg -n AppleSmartBattery | grep TimeRemaining | awk '{ print $5 }') + if [[ ! -z $time_remaining ]]; then + # this value is set to a very high number when the system is calculating + [[ $time_remaining -gt 10000 ]] && local tstring="..." || local tstring=${(f)$(date -u -r $(($time_remaining * 60)) +%k:%M)} + fi + + # get charge values + local max_capacity=$(ioreg -n AppleSmartBattery | grep MaxCapacity | awk '{ print $5 }') + local current_capacity=$(ioreg -n AppleSmartBattery | grep CurrentCapacity | awk '{ print $5 }') + + # logic for string output + [[ ! -z $max_capacity && ! -z $current_capacity ]] && local bat_percent=$(ruby -e "puts ($current_capacity.to_f / $max_capacity.to_f * 100).round.to_i") + [[ $charging =~ true && $connected =~ true ]] && local conn="%F{$POWERLEVEL9K_BATTERY_CHARGING}" && local remain="($tstring)" + [[ ! $charging =~ true && $connected =~ true ]] && local conn="%F{$POWERLEVEL9K_BATTERY_CHARGED}" && local remain="" + if [[ ! $connected =~ true ]]; then + [[ $bat_percent -lt $POWERLVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}" + local remain="($tstring)" + fi + + # display prompt_segment + [[ ! -z $bat_percent ]] && "$1_prompt_segment" "$0" "black" "$DEFAULT_COLOR" "$conn$(print_icon 'BATTERY_ICON'){$fg_color} $bat_percent%% $remain" + fi +} + # Context: user@hostname (who am I and where am I) # Note that if $DEFAULT_USER is not set, this prompt segment will always print prompt_context() { @@ -965,7 +1010,7 @@ powerlevel9k_init() { fi setopt prompt_subst - + setopt LOCAL_OPTIONS unsetopt XTRACE KSH_ARRAYS setopt PROMPT_CR PROMPT_PERCENT PROMPT_SUBST MULTIBYTE -- cgit v1.2.3 From fb6738967ea2e3202d4140c62962d5dd674be430 Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Sun, 18 Oct 2015 16:30:16 -0700 Subject: added Linux support to battery prompt segment --- README.md | 9 +++++---- powerlevel9k.zsh-theme | 50 +++++++++++++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 19 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ac397e65..bb15d5ca 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ configuration is the default: The segments that are currently available are: * [aws](#aws) - The current AWS profile, if active. -* [battery](#battery) - Current battery status(OS X only). +* [battery](#battery) - Current battery status. * [context](#context) - Your username and host. * [dir](#dir) - Your current working directory. * **history** - The command number for the current line. @@ -104,8 +104,8 @@ your `~/.zshrc`: ##### battery -This segment will display your current battery status on an OS X system(fails gracefully -on systems without a battery and non OS X systems). It can be customized in your .zshrc +This segment will display your current battery status (fails gracefully +on systems without a battery). It can be customized in your .zshrc with the environment variables detailed below with their default values. POWERLEVEL9K_BATTERY_CHARGING="yellow" @@ -116,6 +116,7 @@ with the environment variables detailed below with their default values. In addition to the above it supports standard _FOREGROUND value without affecting the icon color +Supports both OS X and Linux(time remaining is only output in OS X) ##### context @@ -146,7 +147,7 @@ To change the way how the current working directory is truncated, just set: # default behaviour is to truncate whole directories In each case you have to specify the length you want to shorten the directory -to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in +to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. ##### ip diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4dda1474..eefeaa5b 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -615,18 +615,19 @@ prompt_aws() { } prompt_battery() { - if [[ -f /usr/sbin/ioreg && -x /usr/sbin/ioreg ]]; then + icons[BATTERY_ICON]=$'\UE894' + # set default values of not specified in shell + [[ -z $POWERLEVEL9K_BATTERY_CHARGING ]] && POWERLEVEL9K_BATTERY_CHARGING="yellow" + [[ -z $POWERLEVEL9K_BATTERY_CHARGED ]] && POWERLEVEL9K_BATTERY_CHARGED="green" + [[ -z $POWERLEVEL9K_BATTERY_DISCONNECTED ]] && POWERLEVEL9K_BATTERY_DISCONNECTED="$DEFAULT_COLOR" + [[ -z $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && POWERLEVEL9K_BATTERY_LOW_THRESHOLD=10 + [[ -z $POWERLEVEL9K_BATTERY_LOW_COLOR ]] && POWERLEVEL9K_BATTERY_LOW_COLOR="red" + [[ -z $POWERLEVEL9K_BATTERY_FOREGROUND ]] && local fg_color="$DEFAULT_COLOR" || local fg_color=$POWERLEVEL9K_BATTERY_FOREGROUND + + if [[ $OS =~ OSX && -f /usr/sbin/ioreg && -x /usr/sbin/ioreg ]]; then # return if there is no battery on system [[ -z $(ioreg -n AppleSmartBattery | grep MaxCapacity) ]] && return - # set default values of not specified in shell - [[ -z $POWERLEVEL9K_BATTERY_CHARGING ]] && POWERLEVEL9K_BATTERY_CHARGING="yellow" - [[ -z $POWERLEVEL9K_BATTERY_CHARGED ]] && POWERLEVEL9K_BATTERY_CHARGED="green" - [[ -z $POWERLEVEL9K_BATTERY_DISCONNECTED ]] && POWERLEVEL9K_BATTERY_DISCONNECTED="$DEFAULT_COLOR" - [[ -z $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && POWERLEVEL9K_BATTERY_LOW_THRESHOLD=10 - [[ -z $POWERLEVEL9K_BATTERY_LOW_COLOR ]] && POWERLEVEL9K_BATTERY_LOW_COLOR="red" - [[ -z $POWERLEVEL9K_BATTERY_FOREGROUND ]] && local fg_color="$DEFAULT_COLOR" || local fg_color=$POWERLEVEL9K_BATTERY_FOREGROUND - # get charge status [[ $(ioreg -n AppleSmartBattery | grep ExternalConnected | awk '{ print $5 }') =~ "Yes" ]] && local connected=true [[ $(ioreg -n AppleSmartBattery | grep IsCharging | awk '{ print $5 }') =~ "Yes" ]] && local charging=true @@ -642,18 +643,37 @@ prompt_battery() { local max_capacity=$(ioreg -n AppleSmartBattery | grep MaxCapacity | awk '{ print $5 }') local current_capacity=$(ioreg -n AppleSmartBattery | grep CurrentCapacity | awk '{ print $5 }') - # logic for string output [[ ! -z $max_capacity && ! -z $current_capacity ]] && local bat_percent=$(ruby -e "puts ($current_capacity.to_f / $max_capacity.to_f * 100).round.to_i") - [[ $charging =~ true && $connected =~ true ]] && local conn="%F{$POWERLEVEL9K_BATTERY_CHARGING}" && local remain="($tstring)" + + # logic for string output + [[ $charging =~ true && $connected =~ true ]] && local conn="%F{$POWERLEVEL9K_BATTERY_CHARGING}" && local remain=" ($tstring)" [[ ! $charging =~ true && $connected =~ true ]] && local conn="%F{$POWERLEVEL9K_BATTERY_CHARGED}" && local remain="" if [[ ! $connected =~ true ]]; then - [[ $bat_percent -lt $POWERLVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}" - local remain="($tstring)" + [[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}" + local remain=" ($tstring)" fi + fi - # display prompt_segment - [[ ! -z $bat_percent ]] && "$1_prompt_segment" "$0" "black" "$DEFAULT_COLOR" "$conn$(print_icon 'BATTERY_ICON')%F{$fg_color} $bat_percent%% $remain" + if [[ $OS =~ Linux ]]; then + local sysp="/sys/class/power_supply" + # reported BAT0 or BAT1 depending on kernel version + [[ -a $sysp/BAT0 ]] && local bat=$sysp/BAT0 + [[ -a $sysp/BAT1 ]] && local bat=$sysp/BAT1 + + # return if no battery found + [[ -z $bat ]] && return + + local bat_percent=$(cat $bat/capacity) + [[ $(cat $bat/status) =~ Charging ]] && local connected=true + [[ $(cat $bat/status) =~ Charging && $bat_percent =~ 100 ]] && local conn="%F{$POWERLEVEL9K_BATTERY_CHARGED}" + [[ $(cat $bat/status) =~ Charging && $bat_percent -lt 100 ]] && local conn="%F{$POWERLEVEL9K_BATTERY_CHARGING}" + if [[ ! $connected =~ true ]]; then + [[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}" + fi fi + + # display prompt_segment + [[ ! -z $bat_percent ]] && "$1_prompt_segment" "$0" "black" "$DEFAULT_COLOR" "$conn$(print_icon 'BATTERY_ICON')%F{$fg_color} $bat_percent%%$remain" } # Context: user@hostname (who am I and where am I) -- cgit v1.2.3 From 3b2971b344e668a57edd8f199dd9681fd0a2f734 Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Sun, 18 Oct 2015 16:32:20 -0700 Subject: erroneous whitespace commit undone --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index bb15d5ca..33b0fc85 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ To change the way how the current working directory is truncated, just set: # default behaviour is to truncate whole directories In each case you have to specify the length you want to shorten the directory -to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in +to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. ##### ip -- cgit v1.2.3 From ff3f6b8e833946a8e98352ceb15e8eb5682e2b69 Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Sun, 18 Oct 2015 19:48:45 -0700 Subject: added time remaining support to battery segment on Linux --- README.md | 2 +- powerlevel9k.zsh-theme | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 33b0fc85..b66304bc 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ with the environment variables detailed below with their default values. In addition to the above it supports standard _FOREGROUND value without affecting the icon color -Supports both OS X and Linux(time remaining is only output in OS X) +Supports both OS X and Linux(time remaining requires the acpi program on Linux) ##### context diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index eefeaa5b..bb24e60a 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -670,6 +670,10 @@ prompt_battery() { if [[ ! $connected =~ true ]]; then [[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && local conn="%F{$POWERLEVEL9K_BATTERY_LOW_COLOR}" || local conn="%F{$POWERLEVEL9K_BATTERY_DISCONNECTED}" fi + if [[ -f /usr/bin/acpi ]]; then + [[ $(acpi | awk '{ print $5 }') =~ rate ]] && local tstring="..." || local tstring=${(f)$(date -u -d @$(acpi | awk '{ print $5 }' | sed s/://g) +%k:%M)} + fi + [[ ! -z $tstring ]] && local remain=" ($tstring)" fi # display prompt_segment -- cgit v1.2.3 From 09bd1f6182d38484e64b324b56c06039e8c67672 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 20 Oct 2015 00:37:17 +0200 Subject: Added documentation. --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index a06b4857..dce45da7 100644 --- a/README.md +++ b/README.md @@ -75,11 +75,12 @@ The segments that are currently available are: * [dir](#dir) - Your current working directory. * **history** - The command number for the current line. * [ip](#ip) - Shows the current IP address. -* **load** - Your machines 5 minute load average and free RAM. +* **load** - Your machines 5 minute load average. * **node_version** - Show the version number of the installed Node.js. * **nvm** - Show the version of Node that is currently active, if it differs from the version used by NVM * **os_icon** - Display a nice little icon, depending on your operating system. * **php_version** - Show the current PHP version. +* [ram](#ram) - Show free RAM and used Swap. * [rbenv](#rbenv) - Ruby environment information (if one is active). * [rspec_stats](#rspec_stats) - Show a ratio of test classes vs code classes for RSpec. * [status](#status) - The return code of the previous command, and status of background jobs. @@ -154,6 +155,15 @@ following variable in your `~/.zshrc`. POWERLEVEL9K_STATUS_VERBOSE=false +##### ram + +By default this segment shows you free RAM and used Swap. If you want to show +only one value, you can specify `POWERLEVEL9K_RAM_ELEMENTS` and set it to either +`ram_free` or `swap_used`. Full example: + + # Show only used swap: + POWERLEVEL9K_RAM_ELEMENTS=(swap_used) + ##### symphony2_tests See [Unit Test Ratios](#unit-test-ratios), below. -- cgit v1.2.3 From 37113bc120dc212ab8fd5cb300ad3d7b167527b9 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sun, 15 Nov 2015 23:53:10 +0100 Subject: Added documentation. --- README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'README.md') diff --git a/README.md b/README.md index f811169e..4d225d14 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ The segments that are currently available are: * [ram](#ram) - Show free RAM and used Swap. * [rbenv](#rbenv) - Ruby environment information (if one is active). * [rspec_stats](#rspec_stats) - Show a ratio of test classes vs code classes for RSpec. +* **rust_version** - Display the current rust version. * [status](#status) - The return code of the previous command, and status of background jobs. * [symphony2_tests](#symphony2_tests) - Show a ratio of test classes vs code classes for Symfony2. * **symphony2_version** - Show the current Symfony2 version, if you are in a Symfony2-Project dir. -- cgit v1.2.3 From df51db14129bc8fb1fa90f9e8aa3ab653fbe247a Mon Sep 17 00:00:00 2001 From: Matthías Páll Gissurarson Date: Wed, 18 Nov 2015 23:45:22 +0100 Subject: added a segment to be able to display the result of a custom command. --- CHANGELOG.md | 4 ++++ README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ powerlevel9k.zsh-theme | 25 +++++++++++++++++++++-- 3 files changed, 81 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 933eceaa..8c21ea0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## v0.3.0 (next) +### New segment `custom_command` added + +A new segment that allows users to define a custom command was added. + ### `virtualenv` changes This segment now respects `VIRTUAL_ENV_DISABLE_PROMPT`. If this variable is set diff --git a/README.md b/README.md index 4d225d14..6a690bfd 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ The segments that are currently available are: * [aws](#aws) - The current AWS profile, if active. * [battery](#battery) - Current battery status. * [context](#context) - Your username and host. +* [custom_command](#custom_command) - A custom command to display the output of. * [dir](#dir) - Your current working directory. * **go_version** - Show the current GO version. * **history** - The command number for the current line. @@ -121,6 +122,59 @@ In addition to the above it supports standard _FOREGROUND value without affectin Supports both OS X and Linux(time remaining requires the acpi program on Linux) +##### custom_command + +The `custom_...` segment lets you add a custom command to your prompt, to e.g. display the wifi signal. You choose a name for the segment yourself, (here signal), and then set the appropriate variables, as so (based on the name you chose) + + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery dir vcs virtualenv custom_signal) + POWERLEVEL9K_CUSTOM_SIGNAL="echo signal: \$(nmcli device wifi | grep yes | awk '{print \$8}')" + POWERLEVEL9K_CUSTOM_SIGNAL_BACKGROUND="blue" + POWERLEVEL9K_CUSTOM_SIGNAL_FOREGROUND="yellow" + POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(aws status load ram) + +gives + +![simplesignal](http://i.imgur.com/SQmYVFL.png) + +Instead of defining the command inline (if it is kinda long or unreadable), one can also add a function to the .zshrc like: + + zsh_signal(){ + local signal=$(nmcli device wifi | grep yes | awk '{print $8}') + local color='%F{yellow}' + [[ $signal -gt 75 ]] && color='%F{green}' + [[ $signal -lt 50 ]] && color='%F{red}' + echo -n "%{$color%}\uf230 $signal%{%f%}" # \uf230 is  + } + +And then by changing the custom commands array (and rearranging a bit the prompt elements) to read: + + POWERLEVEL9K_CUSTOM_SIGNAL="zsh_signal" + +Then this updated command looks like: + +![signal](http://i.imgur.com/hviMATC.png) + +You can also have multiple custom commands. Say you have + + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery custom_signal dir vcs virtualenv custom_time ) + POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(aws status load ram custom_docker) + + POWERLEVEL9K_CUSTOM_SIGNAL="zsh_signal" + POWERLEVEL9K_CUSTOM_SIGNAL_FOREGROUND="white" + POWERLEVEL9K_CUSTOM_SIGNAL_BACKGROUND="black" + + POWERLEVEL9K_CUSTOM_DOCKER='echo "\uf299 $(docker ps -a | grep Up | wc -l)"' # \uf299 is  + POWERLEVEL9K_CUSTOM_DOCKER_FOREGROUND="white" + POWERLEVEL9K_CUSTOM_DOCKER_BACKGROUND="blue" + + POWERLEVEL9K_CUSTOM_TIME='echo "$(date +%s)"' + POWERLEVEL9K_CUSTOM_TIME_FOREGROUND="black" + POWERLEVEL9K_CUSTOM_TIME_BACKGROUND="yellow" + + +Then you get: + +![](http://i.imgur.com/QGGBTqY.png) ##### context diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index cdcb9a96..abab9d8e 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -208,6 +208,15 @@ prompt_aws() { fi } +# Custom: a way for the user to specify custom commands to run, +# and display the output of. +# +prompt_custom() { + local command=POWERLEVEL9K_CUSTOM_$2:u + + "$1_prompt_segment" "${0}_${2:u}" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$(eval ${(P)command})" +} + prompt_battery() { icons[BATTERY_ICON]=$'\UE894' # set default values of not specified in shell @@ -681,7 +690,13 @@ build_left_prompt() { defined POWERLEVEL9K_LEFT_PROMPT_ELEMENTS || POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) for element in "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[@]}"; do - "prompt_$element" "left" + # Check if it is a custom command, otherwise interpet it as + # a prompt. + if [[ $element[0,7] =~ "custom_" ]]; then + "prompt_custom" "left" $element[8,-1] + else + "prompt_$element" "left" + fi done left_prompt_end @@ -692,7 +707,13 @@ build_right_prompt() { defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time) for element in "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[@]}"; do - "prompt_$element" "right" + # Check if it is a custom command, otherwise interpet it as + # a prompt. + if [[ $element[0,7] =~ "custom_" ]]; then + "prompt_custom" "right" $element[8,-1] + else + "prompt_$element" "right" + fi done } -- cgit v1.2.3 From 5a4de1d2742e6e19a1ffb7ea8c418a923599391e Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sun, 13 Dec 2015 12:41:49 +0100 Subject: Split up the `status` segment into a `background_jobs`, `root_indicator` and `status` segment. This fixes #163 --- CHANGELOG.md | 6 ++++++ README.md | 11 ++++++----- powerlevel9k.zsh-theme | 35 ++++++++++++++++++++--------------- 3 files changed, 32 insertions(+), 20 deletions(-) (limited to 'README.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c21ea0e..66520d21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## v0.3.0 (next) +### `status` changes + +The `status` segment was split up into three segments. `background_jobs` prints +an icon if there are background jobs. `root_indicator` prints an icon if the user +is root. The `status` segment focuses now on the status only. + ### New segment `custom_command` added A new segment that allows users to define a custom command was added. diff --git a/README.md b/README.md index 6a690bfd..08728697 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ configuration is the default: The segments that are currently available are: * [aws](#aws) - The current AWS profile, if active. +* **background_jobs** - INdicator for background jobs. * [battery](#battery) - Current battery status. * [context](#context) - Your username and host. * [custom_command](#custom_command) - A custom command to display the output of. @@ -85,9 +86,10 @@ The segments that are currently available are: * **php_version** - Show the current PHP version. * [ram](#ram) - Show free RAM and used Swap. * [rbenv](#rbenv) - Ruby environment information (if one is active). +* **root_indicator** - An indicator if the user is root. * [rspec_stats](#rspec_stats) - Show a ratio of test classes vs code classes for RSpec. * **rust_version** - Display the current rust version. -* [status](#status) - The return code of the previous command, and status of background jobs. +* [status](#status) - The return code of the previous command. * [symphony2_tests](#symphony2_tests) - Show a ratio of test classes vs code classes for Symfony2. * **symphony2_version** - Show the current Symfony2 version, if you are in a Symfony2-Project dir. * [time](#time) - System time. @@ -222,10 +224,9 @@ See [Unit Test Ratios](#unit-test-ratios), below. ##### status -This segment shows the return code of the last command, and the presence of any -background jobs. By default, this segment will always print, but you can -customize it to only print if there is an error or a forked job by setting the -following variable in your `~/.zshrc`. +This segment shows the return code of the last command. By default, this +segment will always print, but you can customize it to only print if there +is an error by setting the following variable in your `~/.zshrc`. POWERLEVEL9K_STATUS_VERBOSE=false diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 3d2d5d2c..d9f6af9b 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -238,6 +238,13 @@ prompt_custom() { "$1_prompt_segment" "${0}_${2:u}" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$(eval ${(P)command})" } +# print an icon, if there are background jobs +prompt_background_jobs() { + if [[ $(jobs -l | wc -l) -gt 0 ]]; then + "$1_prompt_segment" "$0" "$DEFAULT_COLOR" "cyan" "$(print_icon 'BACKGROUND_JOBS_ICON')" + fi +} + prompt_battery() { # The battery can have different states. # Default is "unknown" @@ -537,6 +544,13 @@ prompt_rbenv() { fi } +# print an icon if user is root. +prompt_root_indicator() { + if [[ "$UID" -eq 0 ]]; then + "$1_prompt_segment" "$0" "$DEFAULT_COLOR" "yellow" "$(print_icon 'ROOT_ICON')" + fi +} + # print Rust version number prompt_rust_version() { local rust_version @@ -572,26 +586,17 @@ prompt_rvm() { # Status: (return code, root status, background jobs) set_default POWERLEVEL9K_STATUS_VERBOSE true prompt_status() { - local symbols bg - symbols=() - if [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then if [[ "$RETVAL" -ne 0 ]]; then - symbols+="%F{226}$RETVAL $(print_icon 'CARRIAGE_RETURN_ICON')%f" - bg="red" + "$1_prompt_segment" "$0_ERROR" "red" "226" "$RETVAL $(print_icon 'CARRIAGE_RETURN_ICON')" else - symbols+="%F{046}$(print_icon 'OK_ICON')%f" - bg="black" + "$1_prompt_segment" "$0_OK" "$DEFAULT_COLOR" "046" "$(print_icon 'OK_ICON')" fi else - [[ "$RETVAL" -ne 0 ]] && symbols+="%{%F{red}%}$(print_icon 'FAIL_ICON')%f" - bg="$DEFAULT_COLOR" + if [[ "$RETVAL" -ne 0 ]]; then + "$1_prompt_segment" "$0_ERROR" "$DEFAULT_COLOR" "red" "$(print_icon 'FAIL_ICON')" + fi fi - - [[ "$UID" -eq 0 ]] && symbols+="%{%F{yellow}%} $(print_icon 'ROOT_ICON')%f" - [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}$(print_icon 'BACKGROUND_JOBS_ICON')%f" - - [[ -n "$symbols" ]] && "$1_prompt_segment" "$0" "$bg" "white" "$symbols" } # Symfony2-PHPUnit test ratio @@ -753,7 +758,7 @@ build_left_prompt() { # Right prompt build_right_prompt() { - defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time) + defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs root_indicator history time) for element in "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[@]}"; do # Check if it is a custom command, otherwise interpet it as -- cgit v1.2.3 From bd5955221ed2b200853fe8da1aa2ba3b0dc4c5f3 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 16 Dec 2015 22:23:47 +0100 Subject: Removed trailing whitespace. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 6a690bfd..cba6a73a 100644 --- a/README.md +++ b/README.md @@ -204,7 +204,7 @@ To change the way how the current working directory is truncated, just set: # default behaviour is to truncate whole directories In each case you have to specify the length you want to shorten the directory -to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in +to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. ##### ip -- cgit v1.2.3 From f73de77c2e51d6efe441cea4b8b32445a66b751e Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Thu, 17 Dec 2015 10:40:15 +0100 Subject: Typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 08728697..a68a3152 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ configuration is the default: The segments that are currently available are: * [aws](#aws) - The current AWS profile, if active. -* **background_jobs** - INdicator for background jobs. +* **background_jobs** - Indicator for background jobs. * [battery](#battery) - Current battery status. * [context](#context) - Your username and host. * [custom_command](#custom_command) - A custom command to display the output of. -- cgit v1.2.3 From a7bedd5320f0d6fba5d4179aace5ead1f42c459d Mon Sep 17 00:00:00 2001 From: Niklas Heer Date: Mon, 4 Jan 2016 19:00:02 +0100 Subject: added documentation --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index c611c5d9..e92f29ae 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,20 @@ To change the way how the current working directory is truncated, just set: POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" # default behaviour is to truncate whole directories +You can also change the delimiter (the dots in between) which is used to truncate the working directory. This setting is optional. The default are 2 dots. + + # set the delimiter to an empty string to hide it + POWERLEVEL9K_SHORTEN_DELIMITER="" + # or set it to anything else you want (e.g. 3 dots) + POWERLEVEL9K_SHORTEN_DELIMITER="..." + +With this you could achive the truncate behaviour of the fish shell. Which turncates `/usr/share/plasma` to `/u/s/plasma` + + POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + POWERLEVEL9K_SHORTEN_DELIMITER="" + POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" + + In each case you have to specify the length you want to shorten the directory to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. -- cgit v1.2.3 From e7e11d5ec87f30323d065100c1e8fdb4a98c3aba Mon Sep 17 00:00:00 2001 From: Niklas Heer Date: Mon, 4 Jan 2016 19:26:25 +0100 Subject: fixed documentation --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e92f29ae..a6b69bff 100644 --- a/README.md +++ b/README.md @@ -207,17 +207,16 @@ To change the way how the current working directory is truncated, just set: You can also change the delimiter (the dots in between) which is used to truncate the working directory. This setting is optional. The default are 2 dots. - # set the delimiter to an empty string to hide it + # set the delimiter to an empty string to hide it POWERLEVEL9K_SHORTEN_DELIMITER="" # or set it to anything else you want (e.g. 3 dots) POWERLEVEL9K_SHORTEN_DELIMITER="..." With this you could achive the truncate behaviour of the fish shell. Which turncates `/usr/share/plasma` to `/u/s/plasma` - POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 - POWERLEVEL9K_SHORTEN_DELIMITER="" - POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" - + POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 + POWERLEVEL9K_SHORTEN_DELIMITER="" + POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" In each case you have to specify the length you want to shorten the directory to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in -- cgit v1.2.3 From bb7fca653b522708eb2bb68e18f1e1d5e68d242f Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Tue, 5 Jan 2016 15:18:46 -0800 Subject: README: Cleaning some things up. --- README.md | 54 +++++++++++++++++++----------------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a6b69bff..e39722b2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ ZSH, [Oh-My-Zsh](https://github.com/robbyrussell/oh-my-zsh), or [Prezto](https://github.com/sorin-ionescu/prezto), and can also be installed using [antigen](https://github.com/zsh-users/antigen). -Look like a bad-ass. Impress everyone in 'Screenshot Your Desktop' threads. Use powerlevel9k. +Be a badass. Get more out of your terminal. Impress everyone in 'Screenshot Your +Desktop' threads. Use powerlevel9k. ![](http://bhilburn.org/content/images/2015/01/pl9k-improved.png) @@ -126,7 +127,10 @@ Supports both OS X and Linux(time remaining requires the acpi program on Linux) ##### custom_command -The `custom_...` segment lets you add a custom command to your prompt, to e.g. display the wifi signal. You choose a name for the segment yourself, (here signal), and then set the appropriate variables, as so (based on the name you chose) +The `custom_...` segment allows you to turn the output of a custom command into +a prompt segment. As an example, if you wanted to create a custom segment to +display your WiFi signal strength, you might define a custom segment called +`custom_signal` like this: POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery dir vcs virtualenv custom_signal) POWERLEVEL9K_CUSTOM_SIGNAL="echo signal: \$(nmcli device wifi | grep yes | awk '{print \$8}')" @@ -134,11 +138,8 @@ The `custom_...` segment lets you add a custom command to your prompt, to e.g. d POWERLEVEL9K_CUSTOM_SIGNAL_FOREGROUND="yellow" POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(aws status load ram) -gives - -![simplesignal](http://i.imgur.com/SQmYVFL.png) - -Instead of defining the command inline (if it is kinda long or unreadable), one can also add a function to the .zshrc like: +Instead of writing out the command in-line within the environment variable, you +can also add it as a function in your `.zshrc`: zsh_signal(){ local signal=$(nmcli device wifi | grep yes | awk '{print $8}') @@ -148,41 +149,23 @@ Instead of defining the command inline (if it is kinda long or unreadable), one echo -n "%{$color%}\uf230 $signal%{%f%}" # \uf230 is  } -And then by changing the custom commands array (and rearranging a bit the prompt elements) to read: +You would then invoke the function in your custom segment: POWERLEVEL9K_CUSTOM_SIGNAL="zsh_signal" -Then this updated command looks like: +The command, above, gives you the wireless signal segment shown below: ![signal](http://i.imgur.com/hviMATC.png) -You can also have multiple custom commands. Say you have - - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery custom_signal dir vcs virtualenv custom_time ) - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(aws status load ram custom_docker) - - POWERLEVEL9K_CUSTOM_SIGNAL="zsh_signal" - POWERLEVEL9K_CUSTOM_SIGNAL_FOREGROUND="white" - POWERLEVEL9K_CUSTOM_SIGNAL_BACKGROUND="black" - - POWERLEVEL9K_CUSTOM_DOCKER='echo "\uf299 $(docker ps -a | grep Up | wc -l)"' # \uf299 is  - POWERLEVEL9K_CUSTOM_DOCKER_FOREGROUND="white" - POWERLEVEL9K_CUSTOM_DOCKER_BACKGROUND="blue" - - POWERLEVEL9K_CUSTOM_TIME='echo "$(date +%s)"' - POWERLEVEL9K_CUSTOM_TIME_FOREGROUND="black" - POWERLEVEL9K_CUSTOM_TIME_BACKGROUND="yellow" - - -Then you get: - -![](http://i.imgur.com/QGGBTqY.png) +You can define as many custom segments as you wish. If you think you have +a segment that others would find useful, please consider upstreaming it to the +main theme distribution so that everyone can use it! ##### context -The `context` segment (user@host string) is conditional. This lets you enable it, but only display -it if you are not your normal user or on a remote host (basically, only print it -when it's likely you need it). +The `context` segment (user@host string) is conditional. This lets you enable +it, but only display it if you are not your normal user or on a remote host +(basically, only print it when it's likely you need it). To use this feature, make sure the `context` segment is enabled in your prompt elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`: @@ -205,14 +188,15 @@ To change the way how the current working directory is truncated, just set: POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" # default behaviour is to truncate whole directories -You can also change the delimiter (the dots in between) which is used to truncate the working directory. This setting is optional. The default are 2 dots. +You can also change the delimiter (the dots in between text) from 2 dots to something custom: # set the delimiter to an empty string to hide it POWERLEVEL9K_SHORTEN_DELIMITER="" # or set it to anything else you want (e.g. 3 dots) POWERLEVEL9K_SHORTEN_DELIMITER="..." -With this you could achive the truncate behaviour of the fish shell. Which turncates `/usr/share/plasma` to `/u/s/plasma` +For example, if you wanted the truncation behavior of the `fish` shell, which +truncates `/usr/share/plasma` to `/u/s/plasma`, you would use the following: POWERLEVEL9K_SHORTEN_DIR_LENGTH=1 POWERLEVEL9K_SHORTEN_DELIMITER="" -- cgit v1.2.3 From 1ec2919ff5aa366695ace6ed00646c452b9b83b3 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 6 Jan 2016 19:09:05 +0100 Subject: Added an explanation for the "home" and "folder" icons. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index e39722b2..c402afad 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,16 @@ In each case you have to specify the length you want to shorten the directory to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. +You can even show icons if your are within your homefolder or outside of it +by setting: + + # Greek "alpha" sign + POWERLEVEL9K_HOME_ICON='\u03B1' + # Greek capital "omega" sign + POWERLEVEL9K_FOLDER_ICON='\u03A9' + +To turn off these icons you could set these variables to an empty string. + ##### ip This segment shows you your current internal IP address. It tries to examine -- cgit v1.2.3 From c8ce2264982018a9f576d416c997424b5c330c71 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Thu, 7 Jan 2016 22:49:18 +0100 Subject: Clearer explanation for the home and folder icons. --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c402afad..9a5f7b12 100644 --- a/README.md +++ b/README.md @@ -206,16 +206,17 @@ In each case you have to specify the length you want to shorten the directory to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. -You can even show icons if your are within your homefolder or outside of it -by setting: - # Greek "alpha" sign - POWERLEVEL9K_HOME_ICON='\u03B1' - # Greek capital "omega" sign - POWERLEVEL9K_FOLDER_ICON='\u03A9' +| `Compatible` | `Powerline` | `Awesome Powerline` | Situation +|------------|-----------|-------------------|---------------------------- +| None | None | ![home icon](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | Within Home folder | +| None | None | ![folder icon](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of home folder | To turn off these icons you could set these variables to an empty string. + POWERLEVEL9K_HOME_ICON='' + POWERLEVEL9K_FOLDER_ICON='' + ##### ip This segment shows you your current internal IP address. It tries to examine -- cgit v1.2.3 From cf921fb90c8d239f57391cf6ae459c3d6b6420bf Mon Sep 17 00:00:00 2001 From: Kayant Date: Fri, 15 Jan 2016 23:12:38 +0000 Subject: Add sub folder icon when in home subdirectories Big thanks to @dritter for guidance, @rjorgenson for great explanation. And @bhilburn for further guidance and encouragement. See http://i.imgur.com/2Vncypo.png for a presentation of how it looks. --- README.md | 2 ++ functions/icons.zsh | 4 +++- powerlevel9k.zsh-theme | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 9a5f7b12..520ee440 100644 --- a/README.md +++ b/README.md @@ -210,11 +210,13 @@ others whole directories. | `Compatible` | `Powerline` | `Awesome Powerline` | Situation |------------|-----------|-------------------|---------------------------- | None | None | ![home icon](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | Within Home folder | +| None | None | ![home sub_icon](https://cloud.githubusercontent.com/assets/1544760/12369315/8a5d762c-bbf5-11e5-8a20-ca1179f48d6c.png) | Within Home sub folder | | None | None | ![folder icon](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of home folder | To turn off these icons you could set these variables to an empty string. POWERLEVEL9K_HOME_ICON='' + POWERLEVEL9K_HOME_SUB_ICON='' POWERLEVEL9K_FOLDER_ICON='' ##### ip diff --git a/functions/icons.zsh b/functions/icons.zsh index a0171e69..6a9b044c 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -44,6 +44,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON $'\UE271' #  SUNOS_ICON $'\U1F31E ' # 🌞 HOME_ICON $'\UE12C' #  + HOME_SUB_ICON $'\UE18D' #  FOLDER_ICON $'\UE818' #  NETWORK_ICON $'\UE1AD' #  LOAD_ICON $'\UE190 ' #  @@ -96,6 +97,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON $'\UF17C' #  SUNOS_ICON $'\UF185 ' #  HOME_ICON $'\UF015' #  + HOME_SUB_ICON $'\UF07C' #  FOLDER_ICON $'\UF115' #  NETWORK_ICON $'\UF09E' #  LOAD_ICON $'\UF080 ' #  @@ -143,6 +145,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON 'Lx' SUNOS_ICON 'Sun' HOME_ICON '' + HOME_SUB_ICON '' FOLDER_ICON '' NETWORK_ICON 'IP' LOAD_ICON 'L' @@ -202,4 +205,3 @@ get_icon_names() { echo "POWERLEVEL9K_$key: ${icons[$key]}" done } - diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 119d31e2..c3b12759 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -429,8 +429,10 @@ prompt_dir() { fi local current_icon='' - if [[ $(print -P "%~") == '~'* ]]; then + if [[ $(print -P "%~") == '~' ]]; then "$1_prompt_segment" "$0_HOME" "$2" "blue" "$DEFAULT_COLOR" "$current_path" 'HOME_ICON' + elif [[ $(print -P "%~") == '~'* ]]; then + "$1_prompt_segment" "$0_HOME_SUBFOLDER" "$2" "blue" "$DEFAULT_COLOR" "$current_path" 'HOME_SUB_ICON' else "$1_prompt_segment" "$0_DEFAULT" "$2" "blue" "$DEFAULT_COLOR" "$current_path" 'FOLDER_ICON' fi -- cgit v1.2.3 From 701053aa73cbcfd39d890e7cdb1219c19e2af9ce Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sun, 17 Jan 2016 01:01:39 +0100 Subject: Improved dir icon descriptions. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 520ee440..7e250bf7 100644 --- a/README.md +++ b/README.md @@ -209,9 +209,9 @@ others whole directories. | `Compatible` | `Powerline` | `Awesome Powerline` | Situation |------------|-----------|-------------------|---------------------------- -| None | None | ![home icon](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | Within Home folder | -| None | None | ![home sub_icon](https://cloud.githubusercontent.com/assets/1544760/12369315/8a5d762c-bbf5-11e5-8a20-ca1179f48d6c.png) | Within Home sub folder | -| None | None | ![folder icon](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of home folder | +| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | At the root of your home folder | +| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12369315/8a5d762c-bbf5-11e5-8a20-ca1179f48d6c.png) | Within a subfolder of your home directory | +| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of your home folder | To turn off these icons you could set these variables to an empty string. -- cgit v1.2.3 From 8a3c16ae244adb3e0acc10ed1fe9e91b68833949 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sat, 16 Jan 2016 19:56:27 -0800 Subject: README: Trying out tables to describe variables. --- README.md | 188 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 97 insertions(+), 91 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7e250bf7..cc7becb4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ZSH, [Oh-My-Zsh](https://github.com/robbyrussell/oh-my-zsh), or [Prezto](https://github.com/sorin-ionescu/prezto), and can also be installed using [antigen](https://github.com/zsh-users/antigen). -Be a badass. Get more out of your terminal. Impress everyone in 'Screenshot Your +Get more out of your terminal. Be a badass. Impress everyone in 'Screenshot Your Desktop' threads. Use powerlevel9k. ![](http://bhilburn.org/content/images/2015/01/pl9k-improved.png) @@ -62,8 +62,16 @@ options, including color and icon settings: [Stylizing Your Prompt](https://gith #### Customizing Prompt Segments Customizing your prompt is easy! Select the segments you want to have displayed, and then assign them to either the left or right prompt by adding the following -variables to your `~/.zshrc`. If you don't customize this, the below -configuration is the default: +variables to your `~/.zshrc`. + +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_LEFT_PROMPT_ELEMENTS`|`(context dir rbenv vcs)`|Segment list for left prompt| +|`POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS`|`(status history time)`|Segment list for right prompt| + + +So if you wanted to set these variables manually, you would put the following in +your `~/.zshrc`: POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time) @@ -107,41 +115,46 @@ profile](http://docs.aws.amazon.com/cli/latest/userguide/installing.html), add the `aws` segment to one of the prompts, and define `AWS_DEFAULT_PROFILE` in your `~/.zshrc`: - export AWS_DEFAULT_PROFILE= +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`AWS_DEFAULT_PROFILE`|None|Your AWS profile name| ##### battery -This segment will display your current battery status (fails gracefully -on systems without a battery). It can be customized in your .zshrc -with the environment variables detailed below with their default values. - - POWERLEVEL9K_BATTERY_CHARGING="yellow" - POWERLEVEL9K_BATTERY_CHARGED="green" - POWERLEVEL9K_BATTERY_DISCONNECTED=$DEFAULT_COLOR - POWERLEVEL9K_BATTERY_LOW_THRESHOLD=10 - POWERLEVEL9K_BATTERY_LOW_COLOR="red" +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). -In addition to the above it supports standard _FOREGROUND value without affecting the icon color +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_BATTERY_CHARGING`|`"yellow"`|Color to indicate a charging battery.| +|`POWERLEVEL9K_BATTERY_CHARGED`|`"green"`|Color to indicate a charged battery.| +|`POWERLEVEL9K_BATTERY_DISCONNECTED`|`$DEFAULT_COLOR`|Color to indicate absence of battery.| +|`POWERLEVEL9K_BATTERY_LOW_THRESHOLD`|`10`|Threshold to consider battery level critical.| +|`POWERLEVEL9K_BATTERY_LOW_COLOR`|`"red"`|Color to indicate critically low charge level.| -Supports both OS X and Linux(time remaining requires the acpi program on Linux) +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. ##### custom_command The `custom_...` segment allows you to turn the output of a custom command into a prompt segment. As an example, if you wanted to create a custom segment to display your WiFi signal strength, you might define a custom segment called -`custom_signal` like this: +`custom_wifi_signal` like this: - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery dir vcs virtualenv custom_signal) - POWERLEVEL9K_CUSTOM_SIGNAL="echo signal: \$(nmcli device wifi | grep yes | awk '{print \$8}')" - POWERLEVEL9K_CUSTOM_SIGNAL_BACKGROUND="blue" - POWERLEVEL9K_CUSTOM_SIGNAL_FOREGROUND="yellow" - POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(aws status load ram) + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery dir vcs virtualenv custom_wifi_signal) + POWERLEVEL9K_CUSTOM_WIFI_SIGNAL="echo signal: \$(nmcli device wifi | grep yes | awk '{print \$8}')" + POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_BACKGROUND="blue" + POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_FOREGROUND="yellow" -Instead of writing out the command in-line within the environment variable, you -can also add it as a function in your `.zshrc`: +If you prefer, you can also define the function in your `.zshrc` rather than +putting it in-line with the variable export, as shown above. Just don't forget +to invoke your function from your segment! Example code that achieves the same +result as the above: - zsh_signal(){ + zsh_wifi_signal(){ local signal=$(nmcli device wifi | grep yes | awk '{print $8}') local color='%F{yellow}' [[ $signal -gt 75 ]] && color='%F{green}' @@ -149,9 +162,8 @@ can also add it as a function in your `.zshrc`: echo -n "%{$color%}\uf230 $signal%{%f%}" # \uf230 is  } -You would then invoke the function in your custom segment: - - POWERLEVEL9K_CUSTOM_SIGNAL="zsh_signal" + POWERLEVEL9K_CUSTOM_WIFI_SIGNAL="zsh_wifi_signal" + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context time battery dir vcs virtualenv custom_wifi_signal) The command, above, gives you the wireless signal segment shown below: @@ -170,30 +182,43 @@ it, but only display it if you are not your normal user or on a remote host To use this feature, make sure the `context` segment is enabled in your prompt elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`: - export DEFAULT_USER= +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`DEFAULT_USER`|None|Username to consider a "default context" (you can also use `$USER`)| ##### dir -The `dir` segment shows the current working directory. You can limit the output -to a certain length: - - # Limit to the last two folders - POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 +The `dir` segment shows the current working directory. When using the "Awesome +Powerline" fonts, there are additional glyphs, as well: -To change the way how the current working directory is truncated, just set: +| `Compatible` | `Powerline` | `Awesome Powerline` | Situation +|------------|-----------|-------------------|---------------------------- +| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | At the root of your home folder | +| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12369315/8a5d762c-bbf5-11e5-8a20-ca1179f48d6c.png) | Within a subfolder of your home directory | +| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of your home folder | - # truncate the middle part - POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle" - # truncate from right, leaving the first X characters untouched - POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" - # default behaviour is to truncate whole directories +To turn off these icons you could set these variables to an empty string. -You can also change the delimiter (the dots in between text) from 2 dots to something custom: + POWERLEVEL9K_HOME_ICON='' + POWERLEVEL9K_HOME_SUB_ICON='' + POWERLEVEL9K_FOLDER_ICON='' - # set the delimiter to an empty string to hide it - POWERLEVEL9K_SHORTEN_DELIMITER="" - # or set it to anything else you want (e.g. 3 dots) - POWERLEVEL9K_SHORTEN_DELIMITER="..." +You can limit the output to a certain length by truncating long paths. +Customizations available are: + +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_SHORTEN_DIR_LENGTH`|`2`|If your shorten strategy, below, is +entire directories, this field determines how many directories to leave at the +end. If your shorten strategy is by character count, this field determines how +many characters to allow per directory string.| +|`POWERLEVEL9K_SHORTEN_STRATEGY`|None|How the directory strings should be +truncated. By default, it will truncate whole directories. Other options are +`truncate_middle`, which leaves the start and end of the directory strings, and +`truncate_from_right`, which cuts starting from the end of the string.| +|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to replace strings with +indicating truncation. This can be any string you choose, including an empty +string if you wish to have no delimiter.| For example, if you wanted the truncation behavior of the `fish` shell, which truncates `/usr/share/plasma` to `/u/s/plasma`, you would use the following: @@ -207,18 +232,6 @@ to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in others whole directories. -| `Compatible` | `Powerline` | `Awesome Powerline` | Situation -|------------|-----------|-------------------|---------------------------- -| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | At the root of your home folder | -| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12369315/8a5d762c-bbf5-11e5-8a20-ca1179f48d6c.png) | Within a subfolder of your home directory | -| None | None | ![](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of your home folder | - -To turn off these icons you could set these variables to an empty string. - - POWERLEVEL9K_HOME_ICON='' - POWERLEVEL9K_HOME_SUB_ICON='' - POWERLEVEL9K_FOLDER_ICON='' - ##### ip This segment shows you your current internal IP address. It tries to examine @@ -226,7 +239,9 @@ all currently used network interfaces and prints the first address it finds. In the case that this is not the right IP address you can specify the correct network interface by setting: - POWERLEVEL9K_IP_INTERFACE="eth0" +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_IP_INTERFACE`|None|The NIC for which you wish to display the IP address. Example: `eth0`.| ##### rspec_stats @@ -234,20 +249,19 @@ See [Unit Test Ratios](#unit-test-ratios), below. ##### status -This segment shows the return code of the last command. By default, this -segment will always print, but you can customize it to only print if there -is an error by setting the following variable in your `~/.zshrc`. +This segment shows the return code of the last command. - POWERLEVEL9K_STATUS_VERBOSE=false +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_STATUS_VERBOSE`|`true`|Set to false if you wish to hide this +segment when the last command completed successfully.| ##### ram -By default this segment shows you free RAM and used Swap. If you want to show -only one value, you can specify `POWERLEVEL9K_RAM_ELEMENTS` and set it to either -`ram_free` or `swap_used`. Full example: - - # Show only used swap: - POWERLEVEL9K_RAM_ELEMENTS=(swap_used) +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_RAM_ELEMENTS`|Both|Specify `ram_free` or `swap_used` to only show +one or the other rather than both.| ##### symphony2_tests @@ -255,9 +269,11 @@ See [Unit Test Ratios](#unit-test-ratios), below. ##### time -By default the time is show in 'H:M:S' format. If you want to change it, -just set another format in your `~/.zshrc`. As an example, this is a reversed -time format: +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_TIME_FORMAT`|`'H:M:S'`|ZSH time format to use in this segment.| + +As an example, if you wanted a reversed time format, you would use this: # Reversed time format POWERLEVEL9K_TIME_FORMAT='%D{%S:%M:%H}' @@ -270,22 +286,14 @@ segment, as well: ##### vcs -By default, the `vcs` segment will provide quite a bit of information. If you -would also like for it to display the current hash / changeset, simply define -`POWERLEVEL9K_SHOW_CHANGESET` in your `~/.zshrc`. If activated, it will show -the first 12 characters of the changeset id. To change the amount of characters, -set `POWERLEVEL9K_CHANGESET_HASH_LENGTH` to any value you want. - - # enable the vcs segment in general - POWERLEVEL9K_SHOW_CHANGESET=true - # just show the 6 first characters of changeset - POWERLEVEL9K_CHANGESET_HASH_LENGTH=6 +By default, the `vcs` segment will provide quite a bit of information. Further +customization is provided via: -You can also disable the branch icon in your prompt by setting -`POWERLEVEL9K_HIDE_BRANCH_ICON` to `true`: - - # Hide the branch icon - POWERLEVEL9K_HIDE_BRANCH_ICON=true +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_HIDE_BRANCH_ICON`|`false`|Set to `true` to hide the branch icon from the segment.| +|`POWERLEVEL9K_SHOW_CHANGESET`|`false`|Set to `true` to display the hash / changeset in the segment.| +|`POWERLEVEL9K_CHANGESET_HASH_LENGTH`|`12`|How many characters of the hash / changeset to display in the segment.| **vcs Symbols** @@ -315,12 +323,10 @@ you are using the [ZSH Line Editor](http://zsh.sourceforge.net/Doc/Release/Zsh-L (VI mode). You can enable this either by `.zshrc` configuration or using a plugin, like [Oh-My-Zsh's vi-mode plugin](https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/vi-mode/vi-mode.plugin.zsh). -If you want to display a string other than "NORMAL" or "INSERT" in `command` and -`insert-mode`, you can do so by setting the following variables in your -`~/.zshrc`: - - POWERLEVEL9K_VI_INSERT_MODE_STRING="INSERT" - POWERLEVEL9K_VI_COMMAND_MODE_STRING="NORMAL" +| Variable | Default Value | Description | +|----------|---------------|-------------| +|`POWERLEVEL9K_VI_INSERT_MODE_STRING`|`"INSERT"`|String to display while in 'Insert' mode.| +|`POWERLEVEL9K_VI_COMMAND_MODE_STRING`|`"NORMAL"`|String to display while in 'Command' mode.| #### Unit Test Ratios -- cgit v1.2.3 From 02cb0fd88fa0a06bc3e20b3649c74074ce205556 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sat, 16 Jan 2016 19:59:39 -0800 Subject: README: Turns out you can't linebreak in tables. --- README.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index cc7becb4..057f2fad 100644 --- a/README.md +++ b/README.md @@ -208,17 +208,9 @@ Customizations available are: | Variable | Default Value | Description | |----------|---------------|-------------| -|`POWERLEVEL9K_SHORTEN_DIR_LENGTH`|`2`|If your shorten strategy, below, is -entire directories, this field determines how many directories to leave at the -end. If your shorten strategy is by character count, this field determines how -many characters to allow per directory string.| -|`POWERLEVEL9K_SHORTEN_STRATEGY`|None|How the directory strings should be -truncated. By default, it will truncate whole directories. Other options are -`truncate_middle`, which leaves the start and end of the directory strings, and -`truncate_from_right`, which cuts starting from the end of the string.| -|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to replace strings with -indicating truncation. This can be any string you choose, including an empty -string if you wish to have no delimiter.| +|`POWERLEVEL9K_SHORTEN_DIR_LENGTH`|`2`|If your shorten strategy, below, is entire directories, this field determines how many directories to leave at the end. If your shorten strategy is by character count, this field determines how many characters to allow per directory string.| +|`POWERLEVEL9K_SHORTEN_STRATEGY`|None|How the directory strings should be truncated. By default, it will truncate whole directories. Other options are `truncate_middle`, which leaves the start and end of the directory strings, and `truncate_from_right`, which cuts starting from the end of the string.| +|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to replace strings with indicating truncation. This can be any string you choose, including an empty string if you wish to have no delimiter.| For example, if you wanted the truncation behavior of the `fish` shell, which truncates `/usr/share/plasma` to `/u/s/plasma`, you would use the following: @@ -253,15 +245,13 @@ This segment shows the return code of the last command. | Variable | Default Value | Description | |----------|---------------|-------------| -|`POWERLEVEL9K_STATUS_VERBOSE`|`true`|Set to false if you wish to hide this -segment when the last command completed successfully.| +|`POWERLEVEL9K_STATUS_VERBOSE`|`true`|Set to false if you wish to hide this segment when the last command completed successfully.| ##### ram | Variable | Default Value | Description | |----------|---------------|-------------| -|`POWERLEVEL9K_RAM_ELEMENTS`|Both|Specify `ram_free` or `swap_used` to only show -one or the other rather than both.| +|`POWERLEVEL9K_RAM_ELEMENTS`|Both|Specify `ram_free` or `swap_used` to only show one or the other rather than both.| ##### symphony2_tests -- cgit v1.2.3 From dc4871f1a0b4efd628f2d44089bf0fdf35fa60c4 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sat, 16 Jan 2016 20:02:10 -0800 Subject: README: Minor cleanups --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 057f2fad..1f2a7669 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,7 @@ Customizations available are: |----------|---------------|-------------| |`POWERLEVEL9K_SHORTEN_DIR_LENGTH`|`2`|If your shorten strategy, below, is entire directories, this field determines how many directories to leave at the end. If your shorten strategy is by character count, this field determines how many characters to allow per directory string.| |`POWERLEVEL9K_SHORTEN_STRATEGY`|None|How the directory strings should be truncated. By default, it will truncate whole directories. Other options are `truncate_middle`, which leaves the start and end of the directory strings, and `truncate_from_right`, which cuts starting from the end of the string.| -|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to replace strings with indicating truncation. This can be any string you choose, including an empty string if you wish to have no delimiter.| +|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to use in truncated strings. This can be any string you choose, including an empty string if you wish to have no delimiter.| For example, if you wanted the truncation behavior of the `fish` shell, which truncates `/usr/share/plasma` to `/u/s/plasma`, you would use the following: @@ -226,10 +226,9 @@ others whole directories. ##### ip -This segment shows you your current internal IP address. It tries to examine -all currently used network interfaces and prints the first address it finds. -In the case that this is not the right IP address you can specify the correct -network interface by setting: +This segment tries to examine all currently used network interfaces and prints +the first address it finds. In the case that this is not the right NIC, you can +specify the correct network interface by setting: | Variable | Default Value | Description | |----------|---------------|-------------| -- cgit v1.2.3 From 67895cc5da1fe479d0ae321fba750e199758eee4 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sun, 17 Jan 2016 10:04:04 -0800 Subject: README: Added a tl;dr --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 1f2a7669..d80fd39f 100644 --- a/README.md +++ b/README.md @@ -326,8 +326,11 @@ 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. -### Other +### tl; dr -Looking for more information? We put a lot of stuff in our Wiki! +Want to just get a quick start? Check out the [Show Off Your +Config](https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config) +portion of the wiki to get going. -[Head to the Wiki](https://github.com/bhilburn/powerlevel9k/wiki) +[The Wiki also has a ton of other useful +information!](https://github.com/bhilburn/powerlevel9k/wiki) -- cgit v1.2.3