From e70263a13249e7f345d4065b83b72b966a4b5208 Mon Sep 17 00:00:00 2001 From: He4eT Date: Fri, 10 Nov 2023 13:10:25 +0100 Subject: [PATCH] zsh: use custom theme --- README.md | 1 - root/.zshrc | 10 ++++----- zsh/themes/custom-minimal.zsh-theme | 34 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 zsh/themes/custom-minimal.zsh-theme diff --git a/README.md b/README.md index 7e75b30..2f0b0a3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ 1. Run `./installPackagesFedora.sh` 1. Run `./apply.sh` 1. Install [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh#basic-installation) -1. Replace ugly ● with awesome ▴ in `~/.oh-my-zsh/themes/minimal.zsh-theme` 1. Export gtk-theme and icons with `oomox` and apply them with `lxappearance` 1. [Apply](https://wiki.archlinux.org/title/Cursor_themes) the [Quintom cursor theme](https://gitlab.com/Burning_Cube/quintom-cursor-theme/-/tree/master/) as `Quintom_Snow` diff --git a/root/.zshrc b/root/.zshrc index 45f7150..40ed248 100644 --- a/root/.zshrc +++ b/root/.zshrc @@ -19,16 +19,14 @@ clear # ZSH settings export ZSH="/home/odd/.oh-my-zsh" -# ZSH_CUSTOM=/path/to/new-custom-folder +ZSH_CUSTOM="/home/odd/dotfiles/zsh" -ZSH_THEME="minimal" +ZSH_THEME="custom-minimal" +MODE_INDICATOR="%F{yellow}█%f" +VI_MODE_CURSOR_INSERT=2 CASE_SENSITIVE="false" -MODE_INDICATOR="%F{yellow}#%f" -VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true -# VI_MODE_CURSOR_INSERT=2 - plugins=( git vi-mode diff --git a/zsh/themes/custom-minimal.zsh-theme b/zsh/themes/custom-minimal.zsh-theme new file mode 100644 index 0000000..50673a8 --- /dev/null +++ b/zsh/themes/custom-minimal.zsh-theme @@ -0,0 +1,34 @@ +ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}▴%{$fg[white]%}]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} " + +ZSH_THEME_SVN_PROMPT_PREFIX="$ZSH_THEME_GIT_PROMPT_PREFIX" +ZSH_THEME_SVN_PROMPT_SUFFIX="$ZSH_THEME_GIT_PROMPT_SUFFIX" +ZSH_THEME_SVN_PROMPT_DIRTY="$ZSH_THEME_GIT_PROMPT_DIRTY" +ZSH_THEME_SVN_PROMPT_CLEAN="$ZSH_THEME_GIT_PROMPT_CLEAN" + +ZSH_THEME_HG_PROMPT_PREFIX="$ZSH_THEME_GIT_PROMPT_PREFIX" +ZSH_THEME_HG_PROMPT_SUFFIX="$ZSH_THEME_GIT_PROMPT_SUFFIX" +ZSH_THEME_HG_PROMPT_DIRTY="$ZSH_THEME_GIT_PROMPT_DIRTY" +ZSH_THEME_HG_PROMPT_CLEAN="$ZSH_THEME_GIT_PROMPT_CLEAN" + +vcs_status() { + if (( ${+functions[in_svn]} )) && in_svn; then + svn_prompt_info + elif (( ${+functions[in_hg]} )) && in_hg; then + hg_prompt_info + else + git_prompt_info + fi +} + +precmd() { + local exit_code=$? + + if [ $exit_code -ne 0 ]; then + echo "┌╼ Exit code: $exit_code" + fi +} + +PROMPT='%2~ $(vcs_status)»%b '