├── LICENSE ├── README.md ├── absolute.zsh-theme └── images ├── screenshot.png └── screenshot.xcf /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 [Nelson Brandão](https://github.com/NelsonBrandao) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Absolute - A clean ZSH theme 2 | 3 | Absolute is a [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) shell theme with a very clean look. 4 | 5 | ![screenshot](/images/screenshot.png?raw=true) 6 | 7 | Features: 8 | - Shows just the current directory 9 | - Git branch 10 | - Git status through icons 11 | - ◒ Untracked 12 | - ✚ Added 13 | - ✹ Modified 14 | - ✖ Deleted 15 | - ➜ Renamed 16 | - ⇡ Ahead remote 17 | - ⇣ Behind remote 18 | - Battery percentage when needed ⚡ 81% 19 | - NVM node version ‹ ⬢ 6.3.0 › 20 | - Last command exit code ↵ 21 | 22 | TODO: 23 | - [ ] Background jobs 24 | 25 | ## Installation 26 | 27 | ### [Antigen](https://github.com/zsh-users/antigen) 28 | 29 | If you are using the awesome antigen just run `antigen theme NelsonBrandao/absolute absolute` to try the theme out. 30 | 31 | When ready add `antigen theme NelsonBrandao/absolute absolute` to your `.zshrc`. 32 | 33 | 34 | Note: This theme requires [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) so make sure you have `antigen use oh-my-zsh` on your `.zhrc`. 35 | 36 | ### [oh-my-zsh](http://ohmyz.sh/) 37 | 38 | Download or clone repository into `zsh_custom/themes` 39 | 40 | Copy `absolute.zsh-theme` into `~/.oh-my-zsh/themes/absolute.zsh-theme` 41 | 42 | Set `ZSH_THEME="absolute"` in your `.zshrc` 43 | -------------------------------------------------------------------------------- /absolute.zsh-theme: -------------------------------------------------------------------------------- 1 | # The prompt 2 | PROMPT=' $(_user_host)$(_current_path)$(git_prompt_info) $(_arrow) ' 3 | 4 | # The right-hand prompt 5 | RPROMPT='$(_prompt_nvm)$(git_prompt_status) $(_battery_power)$(_return_status)' 6 | 7 | function _is_osx() { 8 | [[ "$OSTYPE" =~ ^darwin ]] || return 1 9 | } 10 | 11 | function _current_path() { 12 | echo "%{$fg_bold[green]%}%c%{$reset_color%}" 13 | } 14 | 15 | function _arrow() { 16 | echo "%{$fg_bold[blue]%}→%{$reset_color%}" 17 | } 18 | 19 | function _return_status() { 20 | echo " %{$fg_bold[red]%}%(?..↵)%{$reset_color%}" 21 | } 22 | 23 | function _prompt_nvm() { 24 | local node_version=$(nvm current) 25 | [[ -z "${node_version}" ]] || [[ ${node_version} = "none" ]] || [[ ${node_version} = "system" ]] && return 26 | 27 | echo "%{$fg_bold[green]%}‹\U2B22 ${node_version:1}›%{$reset_color%}" 28 | } 29 | 30 | function _battery_power() { 31 | local bat_percent="" 32 | 33 | if _is_osx; then 34 | local state=`pmset -g batt | grep -Eo "%; \w+;" | cut -d';' -f2 | cut -c2-` 35 | [[ ! $state == "discharging" ]] && return 36 | 37 | bat_percent=`pmset -g batt | grep -Eo "\d+%" | cut -d% -f1` 38 | else 39 | local state=`echo -n acpi | awk '{print substr($3,0,length($3)-1)}'` 40 | [[ ! $state == "Discharging" ]] && return 41 | 42 | bat_percent=`echo -n acpi | awk '{print substr($4,0,length($4)-2)}'` 43 | fi 44 | 45 | [[ bat_percent -gt 0 ]] && local color=red 46 | [[ bat_percent -gt 10 ]] && local color=yellow 47 | [[ bat_percent -gt 30 ]] && local color=green 48 | echo " %{$fg_bold[$color]%}‹⚡$bat_percent%%›%{$reset_color%}" 49 | } 50 | 51 | function _user_host() { 52 | if [[ -n $SSH_CONNECTION ]]; then 53 | me="%n@%m" 54 | elif [[ $LOGNAME != $USER ]]; then 55 | me="%n" 56 | fi 57 | if [[ -n $me ]]; then 58 | echo "%{$fg[blue]%}$me%{$reset_color%}:" 59 | fi 60 | } 61 | 62 | ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}:%{$fg[cyan]%}" 63 | ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" 64 | ZSH_THEME_GIT_PROMPT_DIRTY="" 65 | ZSH_THEME_GIT_PROMPT_CLEAN="" 66 | ZSH_THEME_GIT_PROMPT_RENAMED="" 67 | 68 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[yellow]%} ◒" 69 | ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%} ✚" 70 | ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✹" 71 | ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%} ✖" 72 | ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[blue]%} §" 73 | ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[cyan]%}⇡ " 74 | ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg_bold[cyan]%}⇣ " 75 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NelsonBrandao/absolute/de9e2e4838a63f264e336236693dfb7dcbd1d50e/images/screenshot.png -------------------------------------------------------------------------------- /images/screenshot.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NelsonBrandao/absolute/de9e2e4838a63f264e336236693dfb7dcbd1d50e/images/screenshot.xcf --------------------------------------------------------------------------------