From c7a159f28f556721da6545539b88cc47bb0ae8f0 Mon Sep 17 00:00:00 2001 From: JirR02 Date: Tue, 18 Jun 2024 08:02:11 +0200 Subject: [PATCH] Updated .zshrc & added ohmyposh --- .config/ohmyposh/config.toml | 74 ++++++++++++++++++++++++++++++++++++ .zshrc | 12 +----- 2 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 .config/ohmyposh/config.toml diff --git a/.config/ohmyposh/config.toml b/.config/ohmyposh/config.toml new file mode 100644 index 0000000..c3891e9 --- /dev/null +++ b/.config/ohmyposh/config.toml @@ -0,0 +1,74 @@ +#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json + +version = 2 +inal_space = true +console_title_template = '{{ .Shell }} in {{ .Folder }}' + +[[blocks]] + type = 'prompt' + alignment = 'left' + newline = true + + [[blocks.segments]] + type = 'text' + style = 'plain' + foreground = 'p:white' + template = "{{ .UserName }} in " + + [[blocks.segments]] + type = 'path' + style = 'plain' + background = 'transparent' + foreground = 'p:purple' + template = "{{ .Path }}" + + [blocks.segments.properties] + style = 'full' + +[[blocks]] + type = 'prompt' + alignment = 'right' + + [[blocks.segments]] + type = 'git' + style = 'plain' + background = 'transparent' + foreground = 'p:white' + template = "{{ .UpstreamIcon }} {{ .HEAD }}{{ if .Working.Added }}  {{ .Working.String }}{{ end }}{{ if .Working.Deleted }} 󰗨 {{ .Working.String }}{{ end }}{{ if .Working.Modified }}  {{ .Working.String }}{{end}}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}" + + [blocks.segments.properties] + branch_icon = '' + fetch_status = true + fetch_upstream_icon = true + +[[blocks]] + type = 'prompt' + alignment = 'left' + newline = true + + [[blocks.segments]] + type = 'text' + style = 'plain' + background = 'transparent' + foreground_templates = [ + "{{if gt .Code 0}}p:red{{end}}", + "{{if eq .Code 0}}p:magenta{{end}}", + ] + template = ' ' + +[transient_prompt] + background = 'transparent' + foreground_templates = [ + "{{if gt .Code 0}}p:red{{end}}", + "{{if eq .Code 0}}p:magenta{{end}}", + ] + template = ' ' + +[palette] +purple = "#9580ff" +magenta = "#ff80bf" +white = "#eeeeee" +red = "#ff5555" +green = "#8aff80" +orange = "#ffca80" +yellow = "#f1fa8c" diff --git a/.zshrc b/.zshrc index a0ca3c8..82d7a95 100644 --- a/.zshrc +++ b/.zshrc @@ -1,6 +1,3 @@ -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" @@ -8,7 +5,6 @@ export ZSH="$HOME/.oh-my-zsh" # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -ZSH_THEME="powerlevel10k/powerlevel10k" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load # a theme from this variable instead of looking in $ZSH/themes/ @@ -99,10 +95,6 @@ export DBUS_SESSION_BUS_ADRESS="unix:path=$DBUS_LAUNCHD_SESSION_BUS_SOCKET" # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -plugins=(zsh-autosuggestions sudo zsh-syntax-highlighting) - - - # on startup eval $(thefuck --alias) @@ -267,8 +259,8 @@ function importimg { done } -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh +# Initialize Oh My Posh +eval "$(oh-my-posh init zsh --config ~/.config/ohmyposh/config.toml)" # Setup fzf key bindings and fuzzy completion eval "$(fzf --zsh)"