├── ducula_showcase.png ├── LICENSE ├── README.md ├── ducula.zsh-theme └── abbrevs.zsh /ducula_showcase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janjoswig/Ducula/HEAD/ducula_showcase.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jan-Oliver Joswig 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 | Ducula - A zsh-theme inspired by the Dracula project 2 | ==================================================== 3 | 4 | Prompt features 5 | --------------- 6 | * Job status: Indicates if jobs are running in the background :coffee: (idea from agnoster theme) 7 | * Username abbreviations: Uses a different username if the corresponding mapping was set (idea from dieter theme) 8 | * Hostname abbreviations: Uses a different hostname if the corresponding mapping was set (idea from dieter theme) 9 | * Virtual environments: Shows the name of activated virtual environment via ${VIRTUAL_ENV} 10 | * Current path: Displays the full current working directory 11 | * Return status: Shows the error return code (:bat:/:duck:) 12 | * Git messages: Uses `git_super_status` from the git-prompt plugin (set `DUCULA_ENABLE_GIT_STATUS=0` to disable) 13 | * Prompt time: Timestamp (hh:mm) 14 | 15 | Example 16 | ------- 17 | 18 | ![ducula prompt theme](ducula_showcase.png) 19 | 20 | 21 | Installation 22 | ------------ 23 | 24 | Clone the repository into your custom oh-my-zsh themes folder: 25 | 26 | git clone git@github.com:janjoswig/Ducula.git ${ZSH_CUSTOM}/themes/Ducula 27 | 28 | Set the theme in your .zshrc: 29 | 30 | ZSH_THEME="Ducula/ducula" 31 | 32 | Links 33 | ----- 34 | 35 | R. Zhao: This blog post (https://rzhao.io/blog/2015/08/26/zsh-prompt/) was the starting point for the theme 36 | 37 | The agnoster theme: 38 | 39 | The dieter theme: 40 | 41 | The git-prompt plugin: 42 | 43 | Dracula: I think the theme works best in connection with the Dracula (https://draculatheme.com/) color theme 44 | -------------------------------------------------------------------------------- /ducula.zsh-theme: -------------------------------------------------------------------------------- 1 | # name abbreviations (from dieter theme) 2 | typeset -A host_abbrev 3 | typeset -A user_abbrev 4 | 5 | # Defines host_abbrev and user_abbrev 6 | source ${ZSH_CUSTOM}/themes/Ducula/abbrevs.zsh 7 | 8 | # @host 9 | local host_name="%{$fg[white]%}@${host_abbrev[$HOST]:-$HOST}%{$reset_color%}" 10 | 11 | # User colored by priviliges (if not overridden in username abbreviation) 12 | local user_name="%(!.%{$fg[blue]%}.%{$fg[yellow]%})${user_abbrev[$USER]:-$USER}%{$reset_color%}" 13 | local path_string="%{$fg[cyan]%}%~" 14 | local prompt_string="»" 15 | local time_string="%{$fg[magenta]%}%T" 16 | 17 | # Make prompt_string red if the previous command failed (and change bat to duck). 18 | local return_status="%(?:%{$fg[blue]%}🦇$prompt_string:%{$fg[red]%}🦆%?$prompt_string)" 19 | 20 | # From agnoster theme; Indicate if background jobs are running 21 | job_status() { 22 | typeset -a job_running 23 | 24 | if [[ $(jobs -l | wc -l) -gt 0 ]] 25 | then 26 | job_running+="%{%F{cyan}%}☕ " 27 | # else # maybe too distracting 28 | # job_running+="%{%F{cyan}%}⭐ " 29 | fi 30 | 31 | echo "$job_running" 32 | } 33 | 34 | # git-prompt options 35 | ZSH_THEME_GIT_PROMPT_PREFIX="" # "(" 36 | ZSH_THEME_GIT_PROMPT_SUFFIX="" # ")" 37 | ZSH_THEME_GIT_PROMPT_SEPARATOR="|" 38 | ZSH_THEME_GIT_PROMPT_BRANCH=" %{$fg_bold[magenta]%}" 39 | ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[red]%}%{●%G%}" 40 | ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{✖%G%}" 41 | ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[blue]%}%{✚%G%}" 42 | ZSH_THEME_GIT_PROMPT_BEHIND="%{↓%G%}" 43 | ZSH_THEME_GIT_PROMPT_AHEAD="%{↑%G%}" 44 | ZSH_THEME_GIT_PROMPT_UNTRACKED="%{…%G%}" 45 | ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}%{✔%G%}" 46 | 47 | # From agnoster theme; Add virtual environment information 48 | virtual_env() { 49 | typeset -a venv_prompt 50 | if [[ ! -z "$VIRTUAL_ENV" ]]; then 51 | # venv_prompt+=" в:${VIRTUAL_ENV##*/}" 52 | # Shorten venv name by first occurence of a hyphen (pipenv) 53 | venv_prompt+=" $(echo "в:`basename $VIRTUAL_ENV`" | cut -d'-' -f1-1)" 54 | fi 55 | echo "${venv_prompt}" 56 | } 57 | 58 | # Don't let other actions to the virtual environment prompt interfere 59 | VIRTUAL_ENV_DISABLE_PROMPT=1 60 | 61 | # Left prompt 62 | PROMPT='$(job_status)${user_name}${host_name}$(virtual_env) ${path_string} ${return_status} %{$reset_color%}' 63 | 64 | # Check if git status should be enabled (default: enabled) 65 | : ${DUCULA_ENABLE_GIT_STATUS:=1} 66 | 67 | # Right prompt 68 | if [[ $DUCULA_ENABLE_GIT_STATUS -eq 1 ]]; then 69 | RPROMPT='$(git_super_status) ${time_string}%{$reset_color%}' 70 | else 71 | RPROMPT='${time_string}%{$reset_color%}' 72 | fi 73 | 74 | # Other symbols (scratch): ⚙ ✗ ✘ ⚡⭒ ⭲ 75 | -------------------------------------------------------------------------------- /abbrevs.zsh: -------------------------------------------------------------------------------- 1 | # Abbreviations used for host/user names 2 | # Change these mappings as you need it 3 | host_abbrev=(\ 4 | 'qcw21' "%{$fg[yellow]%}л"\ 5 | 'qcw01' "%{$fg[yellow]%}р1"\ 6 | 'qcw02' "%{$fg[yellow]%}р2"\ 7 | 'qcw03' "%{$fg[yellow]%}р3"\ 8 | 'qcw04' "%{$fg[yellow]%}р4"\ 9 | 'qcw05' "%{$fg[yellow]%}р5"\ 10 | 'qcw06' "%{$fg[yellow]%}р6"\ 11 | 'qcw07' "%{$fg[yellow]%}р7"\ 12 | 'qcw08' "%{$fg[yellow]%}р8"\ 13 | 'qcw09' "%{$fg[yellow]%}р9"\ 14 | 'qcw10' "%{$fg[yellow]%}р10"\ 15 | 'qcw11' "%{$fg[yellow]%}р11"\ 16 | 'qcw12' "%{$fg[yellow]%}р12"\ 17 | 'qcw13' "%{$fg[yellow]%}р13"\ 18 | 'qcw14' "%{$fg[yellow]%}р14"\ 19 | 'qcw15' "%{$fg[yellow]%}р15"\ 20 | 'qcw16' "%{$fg[yellow]%}р16"\ 21 | 'qcw17' "%{$fg[yellow]%}р17"\ 22 | 'qcw18' "%{$fg[yellow]%}р18"\ 23 | 'qcw19' "%{$fg[yellow]%}р19"\ 24 | 'qcw20' "%{$fg[yellow]%}р20"\ 25 | 'qcw22' "%{$fg[yellow]%}р22"\ 26 | 'qcw23' "%{$fg[yellow]%}р23"\ 27 | 'qcw24' "%{$fg[yellow]%}р24"\ 28 | 'qcw25' "%{$fg[yellow]%}р25"\ 29 | 'qcw26' "%{$fg[yellow]%}р26"\ 30 | 'qcw27' "%{$fg[yellow]%}р27"\ 31 | 'qcw28' "%{$fg[yellow]%}р28"\ 32 | 'qcw29' "%{$fg[yellow]%}р29"\ 33 | 'qcw30' "%{$fg[yellow]%}р30"\ 34 | 'qcw31' "%{$fg[yellow]%}р31"\ 35 | 'qcw32' "%{$fg[yellow]%}р32"\ 36 | 'qcw33' "%{$fg[yellow]%}р33"\ 37 | 'qcw34' "%{$fg[yellow]%}р34"\ 38 | 'qcw35' "%{$fg[yellow]%}р35"\ 39 | 'qcw36' "%{$fg[yellow]%}р36"\ 40 | 'qcw37' "%{$fg[yellow]%}р37"\ 41 | 'qcw38' "%{$fg[yellow]%}р38"\ 42 | 'qcw39' "%{$fg[yellow]%}р39"\ 43 | 'qcw40' "%{$fg[yellow]%}р40"\ 44 | 'qcw41' "%{$fg[yellow]%}р41"\ 45 | 'qcw42' "%{$fg[yellow]%}р42"\ 46 | 'qcw43' "%{$fg[yellow]%}р43"\ 47 | 'qcw44' "%{$fg[yellow]%}р44"\ 48 | 'qcw45' "%{$fg[yellow]%}р45"\ 49 | 'qcw46' "%{$fg[yellow]%}р46"\ 50 | 'qcw47' "%{$fg[yellow]%}р47"\ 51 | 'qcw48' "%{$fg[yellow]%}р48"\ 52 | 'qcw49' "%{$fg[yellow]%}р49"\ 53 | 'qcw50' "%{$fg[yellow]%}р50"\ 54 | 'qcw51' "%{$fg[yellow]%}р51"\ 55 | 'qcw52' "%{$fg[yellow]%}р52"\ 56 | 'qcw53' "%{$fg[yellow]%}р53"\ 57 | 'qcw54' "%{$fg[yellow]%}р54"\ 58 | 'qcw55' "%{$fg[yellow]%}р55"\ 59 | 'qcw56' "%{$fg[yellow]%}р56"\ 60 | 'qcw57' "%{$fg[yellow]%}р57"\ 61 | 'qcw58' "%{$fg[yellow]%}р58"\ 62 | 'qcw59' "%{$fg[yellow]%}р59"\ 63 | 'qcw60' "%{$fg[yellow]%}р60"\ 64 | 'sponk' "%{$fg[yellow]%}м"\ 65 | 'sponk-pc' "%{$fg[yellow]%}д"\ 66 | 'qcm01' "%{$fg[yellow]%}г"\ 67 | 'qcm02' "%{$fg[yellow]%}с2"\ 68 | 'qcm03' "%{$fg[yellow]%}с3"\ 69 | 'qcm04' "%{$fg[yellow]%}с4"\ 70 | 'qcm05' "%{$fg[yellow]%}с5"\ 71 | 'qcm06' "%{$fg[yellow]%}с6"\ 72 | 'qcm07' "%{$fg[yellow]%}с7"\ 73 | 'qcm08' "%{$fg[yellow]%}с8"\ 74 | ) 75 | 76 | user_abbrev=('janjoswig' "я") 77 | --------------------------------------------------------------------------------