Skip to content
An asynchronous zsh prompt
Shell AppleScript
Branch: master
Clone or download
Latest commit ddae8e4 Jul 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github update issue template Jul 1, 2019
libs update libs Jun 14, 2019
modules fix #26 Jul 1, 2019
screenshots update gruvbox.png Aug 29, 2018
.gitignore .gitignore Dec 17, 2018
.gitmodules added promptlib Jun 24, 2017
LICENSE update license Jan 16, 2019
README.md v2.0.0 Mar 27, 2019
alien.applescript update apple script Jun 14, 2019
alien.plugin.zsh init Jul 24, 2016
alien.zsh prompt-renderer: allow using sections in PROMPT and RPROMPT Mar 12, 2019
alien.zsh-theme init Jul 24, 2016

README.md

alien

GitHub tag

Contributors GitHub last commit (branch) license GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests

alien theme is faster than a lot other themes.

Why? It updates part of the prompt asyncronously - the time consuming processings like git status checking, git dirty copy checking etc.

How? It starts a background job for these process, and in the mean time draws initial prompt and lets you use the terminal as you would normally.

alien theme is independent of any library like Oh-My-Zsh or Prezto. Whatever it needs already included inside. The only exception is font. You need to install the powerline patched fonts to properly display the prompt.

Asciicast v2.0.0

asciicast

Requirements

  • zsh (obviously)
  • powerline patched fonts see here

Installation

Add the following line to your .zshrc depending on your zsh plugin manager

antigen:

antigen theme eendroroy/alien alien

zgen:

zgen load eendroroy/alien

zplug:

zplug "eendroroy/alien"

oh-my-zsh: Overriding and Adding Themes

Manually cloning

git clone https://github.com/eendroroy/alien.git
cd alien
git submodule update --init --recursive

Add the following line to your ~/.zshrc

source ~/alien/alien.zsh

Configuration

sections

To define the order of sections to display:

export ALIEN_SECTIONS_LEFT=(
  exit
  battery
  user
  path
  newline
  ssh
  venv
  prompt
)

export ALIEN_SECTIONS_RIGHT=(
  time
)

To define if sections are to be loaded asyncronously add :async to the section-name:

export ALIEN_SECTIONS_LEFT=(
  exit
  battery
  user
  path
  vcs_branch:async
  vcs_status:async
  vcs_dirty:async
  newline
  ssh
  venv
  prompt
)

section seperator

To change the section-separator:

export ALIEN_SECTIONS_LEFT_SEP_SYM=
export ALIEN_SECTIONS_RIGHT_SEP_SYM=

prompt-section

To change the symbol of the input-prompt:

export ALIEN_PROMPT_SYM=

To change colors:

export ALIEN_PROMPT_FG=100

exit-section

To disable the numeric exit-code:

export ALIEN_SECTION_EXIT_CODE=0

To change colors:

export ALIEN_SECTION_EXIT_FG=100
export ALIEN_SECTION_EXIT_BG=150
export ALIEN_SECTION_EXIT_BG_ERROR=200

time-section

To change the format::

export ALIEN_SECTION_TIME_FORMAT=%H:%M:%S # default is %r

To change colors:

export ALIEN_SECTION_TIME_FG=100
export ALIEN_SECTION_TIME_BG=150

battery-section

To change colors:

export ALIEN_SECTION_BATTERY_FG=100
export ALIEN_SECTION_BATTERY_BG=150

user-section

To show the hostname:

export ALIEN_SECTION_USER_HOST=1

To change colors:

export ALIEN_SECTION_USER_FG=100
export ALIEN_SECTION_USER_BG=150

path-section

To change the number of path-components to display:

export ALIEN_SECTION_PATH_COMPONENTS=2

To change colors:

export ALIEN_SECTION_PATH_FG=100
export ALIEN_SECTION_PATH_BG=150

vcs_branch-section

To change colors:

export ALIEN_SECTION_VCS_BRANCH_FG=100
export ALIEN_SECTION_VCS_BRANCH_BG=150

vcs_status-section

To change colors:

export ALIEN_SECTION_VCS_STATUS_FG=100
export ALIEN_SECTION_VCS_STATUS_BG=150

vcs_dirty-section

To change colors:

export ALIEN_SECTION_VCS_DIRTY_FG=100
export ALIEN_SECTION_VCS_DIRTY_BG=150

color scheme

add all configurations before plugin definitions

you can chose from 3 different color schemes (blue is the default)

in ~/.zshrc just add any from the following three lines before your antigen theme ... line

export ALIEN_THEME="blue"

blue

export ALIEN_THEME="green"

green

export ALIEN_THEME="red"

red

export ALIEN_THEME="soft"

soft

export ALIEN_THEME="gruvbox"

gruvbox

Custom Color

ALIEN_PROMPT_FG=87

ALIEN_SECTION_EXIT_FG=0
ALIEN_SECTION_EXIT_BG=87
ALIEN_SECTION_EXIT_BG_ERROR=202

ALIEN_SECTION_TIME_FG=0
ALIEN_SECTION_TIME_BG=193

ALIEN_SECTION_BATTERY_FG=0
ALIEN_SECTION_BATTERY_BG=193

ALIEN_SECTION_USER_FG=0
ALIEN_SECTION_USER_BG=87

ALIEN_SECTION_PATH_FG=0
ALIEN_SECTION_PATH_BG=45

ALIEN_SECTION_VCS_BRANCH_FG=87
ALIEN_SECTION_VCS_BRANCH_BG=238
ALIEN_SECTION_VCS_STATUS_FG=87
ALIEN_SECTION_VCS_STATUS_BG=238
ALIEN_SECTION_VCS_DIRTY_FG=87
ALIEN_SECTION_VCS_DIRTY_BG=238

ALIEN_SECTION_SSH_FG=238

ALIEN_SECTION_VENV_FG=238

PLIB_GIT_TRACKED_COLOR=193
PLIB_GIT_UNTRACKED_COLOR=87

Or creating a new theme file:

/path/to/custom/theme.zsh

#!/usr/bin/env zsh

alien_theme(){
  ALIEN_PROMPT_FG=87

  ALIEN_SECTION_EXIT_FG=0
  ALIEN_SECTION_EXIT_BG=87
  ALIEN_SECTION_EXIT_BG_ERROR=202

  ALIEN_SECTION_TIME_FG=0
  ALIEN_SECTION_TIME_BG=193

  ALIEN_SECTION_BATTERY_FG=0
  ALIEN_SECTION_BATTERY_BG=193

  ALIEN_SECTION_USER_FG=0
  ALIEN_SECTION_USER_BG=87

  ALIEN_SECTION_PATH_FG=0
  ALIEN_SECTION_PATH_BG=45

  ALIEN_SECTION_VCS_BRANCH_FG=87
  ALIEN_SECTION_VCS_BRANCH_BG=238
  ALIEN_SECTION_VCS_STATUS_FG=87
  ALIEN_SECTION_VCS_STATUS_BG=238
  ALIEN_SECTION_VCS_DIRTY_FG=87
  ALIEN_SECTION_VCS_DIRTY_BG=238

  ALIEN_SECTION_SSH_FG=238

  ALIEN_SECTION_VENV_FG=238

  PLIB_GIT_TRACKED_COLOR=193
  PLIB_GIT_UNTRACKED_COLOR=87
}

Then activate the theme using:

export ALIEN_CUSTOM_THEME_PATH=/path/to/custom/theme.zsh

Keep previous PROMPT:

export ALIEN_KEEP_PROMPT=1

This will keep previous prompt while new prompt is being rendered.

nerd font

Enable Nerd Font

export USE_NERD_FONT=1

Note: Nerd fonts

promptlib-zsh Configs:

customize symbols

export ALIEN_GIT_STASH_SYM=@
export ALIEN_GIT_SYM=G
export ALIEN_HG_SYM=H
export ALIEN_SVN_SYM=S
export ALIEN_BRANCH_SYM=
# Symbols from promptlib
export PLIB_GIT_ADD_SYM=+
export PLIB_GIT_DEL_SYM=-
export PLIB_GIT_MOD_SYM=⭑
export PLIB_GIT_NEW_SYM=?
export PLIB_GIT_PUSH_SYM=↑
export PLIB_GIT_PULL_SYM=↓

Note: this overrides USE_NERD_FONT configuration.

customize colors

export PLIB_GIT_TRACKED_COLOR=green
export PLIB_GIT_UNTRACKED_COLOR=red

Libraries Used

Author

Contributing

Bug reports and pull requests are welcome on GitHub at alien repository. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

  1. Fork it ( https://github.com/eendroroy/alien/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

The project is available as open source under the terms of the MIT License.

You can’t perform that action at this time.