Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/next' into nerdfont
Browse files Browse the repository at this point in the history
* upstream/next: (41 commits)
  vcs icons: fixing branch spacing and remote icon in fontawesome
  same deal for the "FAIL_ICON"!
  fixing the "OK_ICON" in 'awesome-fontconfig' which somehow got broken
  Change powerlevel9k_init to prompt_powerlevel_setup
  Fix MacOS specific battery segment logic.
  Minor fix-up to the README.
  Adding license note about the new logo.
  more typos
  Adding the new logo to the README!
  fixed typo fixed issue with POWERLEVEL9K_PUBLIC_IP_NONE being empty .. i hope
  fixed typo
  reverted testing value to default value
  added link to segemnt documenation in README
  fixed issue with POWERLEVEL9K_PUBLIC_IP_NONE being empty for real
  fixed issue with POWERLEVEL9K_PUBLIC_IP_NONE being empty
  added README section for public_ip segment
  added the ability to specify and only attempt a particular method
  Add Changelog for v0.5.0
  added configurable string when there is no IP
  updated some comments changed some offline behavior
  ...
  • Loading branch information
kaymmm committed Jan 21, 2017
2 parents 82aa37d + 9ead1c1 commit f9d2f3a
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 54 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ Added an option to configure the path separator. If you want something
else than an ordinary slash, you could set
`POWERLEVEL9K_DIR_PATH_SEPARATOR` to whatever you want.

## v0.5.0

### `load` and `ram` changes

These two segments now support BSD.

### `vcs` changes

- We implemented a huge speed improvement for this segment.
- Now this segment supports Subversion repositories.
- Add ability to hide tags by setting `POWERLEVEL9K_VCS_HIDE_TAGS` to true.

## `anaconda` changes

Speed improvements for `anaconda` segment.

## v0.4.0

### Development changes
Expand Down Expand Up @@ -85,6 +101,11 @@ Added new `docker_machine` segment that will show your Docker machine.
A new segment `anaconda` was added that shows the current used
anaconda environment.

## New segment `pyenv` added

This segment shows your active python version as reported by `pyenv`.


## v0.3.2

### `vcs` changes
Expand Down
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## powerlevel9k Theme for ZSH

![](https://raw.githubusercontent.com/bhilburn/powerlevel9k-logo/master/logo-banner.png)
---
[![Build Status](https://travis-ci.org/bhilburn/powerlevel9k.svg?branch=next)](https://travis-ci.org/bhilburn/powerlevel9k)
[![Join the chat at https://gitter.im/bhilburn/powerlevel9k](https://badges.gitter.im/bhilburn/powerlevel9k.svg)](https://gitter.im/bhilburn/powerlevel9k?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand Down Expand Up @@ -90,6 +90,7 @@ 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.
* [`public_ip`](#public_ip) - Shows your public IP address.
* `load` - Your machine's load averages.
* `os_icon` - Display a nice little icon, depending on your operating system.
* `ram` - Show free RAM.
Expand Down Expand Up @@ -136,6 +137,7 @@ The segments that are currently available are:
* [`custom_command`](#custom_command) - Create a custom segment to display the
output of an arbitrary command.
* [`todo`](http://todotxt.com/) - Shows the number of tasks in your todo.txt tasks file.
* `detect-virt` - Virtualization detection with systemd

---------------------------------------------------------------------------------

Expand Down Expand Up @@ -239,9 +241,17 @@ 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`:

You can set the `POWERLEVEL9K_CONTEXT_HOST_DEPTH` variable to change how the
hostname is displayed. See (ZSH Manual)[http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Login-information]
for details. Default is set to %m which will show the hostname up to the first ‘.’
You can set it to %{N}m where N is an integer to show that many segments of system
hostname. Setting N to a negative integer will show that many segments from the
end of the hostname.

| Variable | Default Value | Description |
|----------|---------------|-------------|
|`DEFAULT_USER`|None|Username to consider a "default context" (you can also use `$USER`)|
|`POWERLEVEL9K_CONTEXT_HOST_DEPTH`|%m|Customizable host depth on prompt|

##### dir

Expand Down Expand Up @@ -306,6 +316,29 @@ specify the correct network interface by setting:
|----------|---------------|-------------|
|`POWERLEVEL9K_IP_INTERFACE`|None|The NIC for which you wish to display the IP address. Example: `eth0`.|

##### public_ip

This segment will display your public IP address. There are several methods of obtaining this
information and by default it will try all of them starting with the most efficient. You can
also specify which method you would like it to use. The methods available are dig using opendns,
curl, or wget. The host used for wget and curl is http://ident.me by default but can be set to
another host if you prefer.

The public_ip segment will attempt to update your public IP address every 5 minutes by default(also
configurable by the user). If you lose connection your cached IP address will be displayed until
your timeout expires at which point every time your prompt is generated a new attempt will be made.
Until an IP is successfully pulled the value of $POWERLEVEL9K_PUBLIC_IP_NONE will be displayed for
this segment. If this value is empty(the default)and $POWERLEVEL9K_PUBLIC_IP_FILE is empty the
segment will not be displayed.

| Variable | Default Value | Description |
|----------|---------------|-------------|
|`POWERLEVEL9K_PUBLIC_IP_FILE`|'/tmp/p8k_public_ip'|This is the file your public IP is cached in.|
|`POWERLEVEL9K_PUBLIC_IP_HOST`|'http://ident.me'|This is the default host to get your public IP.|
|`POWERLEVEL9K_PUBLIC_IP_TIMEOUT`|300|The amount of time in seconds between refreshing your cached IP.|
|`POWERLEVEL9K_PUBLIC_IP_METHOD`|None|You can set this to any of 'dig', 'curl', or 'wget' to only use that method to refresh your IP.|
|`POWERLEVEL9K_PUBLIC_IP_NONE`|None|The string displayed when an IP was not obtained|

##### rbenv

This segment shows the version of Ruby being used when using `rbenv` to change your current Ruby stack.
Expand Down Expand Up @@ -421,4 +454,7 @@ portion of the wiki to get going.
information!](https://github.com/bhilburn/powerlevel9k/wiki)

### License
MIT

Project: MIT

Logo: CC-BY-SA. Source repository: https://github.com/bhilburn/powerlevel9k-logo
35 changes: 24 additions & 11 deletions functions/icons.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ case $POWERLEVEL9K_MODE in
VCS_TAG_ICON $'\uE817 ' #
VCS_BOOKMARK_ICON $'\uE87B' #
VCS_COMMIT_ICON $'\uE821 ' #
VCS_BRANCH_ICON $'\uE220' #
VCS_REMOTE_BRANCH_ICON ' '$'\uE804 ' #
VCS_BRANCH_ICON $'\uE220 ' #
VCS_REMOTE_BRANCH_ICON $'\u2192' #
VCS_GIT_ICON $'\uE20E ' #
VCS_GIT_GITHUB_ICON $'\uE20E ' #
VCS_GIT_BITBUCKET_ICON $'\uE20E ' #
VCS_GIT_GITLAB_ICON $'\uE20E ' #
VCS_HG_ICON $'\uE1C3 ' #
VCS_SVN_ICON '(svn) '
RUST_ICON ''
PYTHON_ICON $'\U1F40D' # 🐍
SWIFT_ICON ''
PUBLIC_IP_ICON ''
)
;;
'awesome-fontconfig')
Expand All @@ -93,8 +97,8 @@ case $POWERLEVEL9K_MODE in
TEST_ICON $'\uF291' #
TODO_ICON $'\u2611' #
BATTERY_ICON $'\U1F50B' # 🔋
OK_ICON $'\uF23A' #
FAIL_ICON $'\uF281' #
OK_ICON $'\u2713' #
FAIL_ICON $'\u2718' #
SYMFONY_ICON 'SF'
NODE_ICON $'\u2B22' #
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
Expand All @@ -120,14 +124,18 @@ case $POWERLEVEL9K_MODE in
VCS_TAG_ICON $'\uF217 ' #
VCS_BOOKMARK_ICON $'\uF27B' #
VCS_COMMIT_ICON $'\uF221 ' #
VCS_BRANCH_ICON $'\uF126' #
VCS_REMOTE_BRANCH_ICON ' '$'\uF204 ' #
VCS_GIT_ICON $'\uF113 ' #
VCS_BRANCH_ICON $'\uF126 ' #
VCS_REMOTE_BRANCH_ICON $'\u2192' #
VCS_GIT_ICON $'\uF1D3 ' #
VCS_GIT_GITHUB_ICON $'\uF113 ' #
VCS_GIT_BITBUCKET_ICON $'\uF171 ' #
VCS_GIT_GITLAB_ICON $'\uF296 ' #
VCS_HG_ICON $'\uF0C3 ' #
VCS_SVN_ICON '(svn) '
RUST_ICON $'\uE6A8' #
PYTHON_ICON $'\U1F40D' # 🐍
SWIFT_ICON ''
PUBLIC_IP_ICON ''
)
;;
'nerd-patched-complete')
Expand All @@ -147,7 +155,7 @@ case $POWERLEVEL9K_MODE in
BACKGROUND_JOBS_ICON $'\uF013 ' #
TEST_ICON $'\uF188' #
TODO_ICON $'\u2611' #
BATTERY_ICON $'\U1F50B' # 🔋
BATTERY_ICON $'\uF241' #
OK_ICON $'\u2713' #
FAIL_ICON $'\u2718' #
SYMFONY_ICON $'\uE757' #
Expand Down Expand Up @@ -181,8 +189,9 @@ case $POWERLEVEL9K_MODE in
VCS_HG_ICON $'\uF0C3 ' #
VCS_SVN_ICON '(svn) '
RUST_ICON $'\uE7A8' #
PYTHON_ICON $'\U1F40D' # 🐍
PYTHON_ICON $'\uE73C' #
SWIFT_ICON $'\uE755' #
PUBLIC_IP_ICON ''
)
;;
*)
Expand Down Expand Up @@ -233,11 +242,15 @@ case $POWERLEVEL9K_MODE in
VCS_BRANCH_ICON $'\uE0A0 ' #
VCS_REMOTE_BRANCH_ICON $'\u2192' #
VCS_GIT_ICON ''
VCS_GIT_GITHUB_ICON ''
VCS_GIT_BITBUCKET_ICON ''
VCS_GIT_GITLAB_ICON ''
VCS_HG_ICON ''
VCS_SVN_ICON ''
RUST_ICON ''
RUST_ICON ''
PYTHON_ICON ''
SWIFT_ICON ''
SWIFT_ICON 'Swift'
PUBLIC_IP_ICON ''
)
;;
esac
Expand Down
13 changes: 12 additions & 1 deletion functions/vcs.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,18 @@ function +vi-hg-bookmarks() {

function +vi-vcs-detect-changes() {
if [[ "${hook_com[vcs]}" == "git" ]]; then
vcs_visual_identifier='VCS_GIT_ICON'

local remote=`git ls-remote --get-url`
if [[ "$remote" =~ "github" ]] then
vcs_visual_identifier='VCS_GIT_GITHUB_ICON'
elif [[ "$remote" =~ "bitbucket" ]] then
vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON'
elif [[ "$remote" =~ "gitlab" ]] then
vcs_visual_identifier='VCS_GIT_GITLAB_ICON'
else
vcs_visual_identifier='VCS_GIT_ICON'
fi

elif [[ "${hook_com[vcs]}" == "hg" ]]; then
vcs_visual_identifier='VCS_HG_ICON'
elif [[ "${hook_com[vcs]}" == "svn" ]]; then
Expand Down
Loading

0 comments on commit f9d2f3a

Please sign in to comment.