Added oh my posh

This commit is contained in:
mattr
2024-10-05 13:17:39 -05:00
parent bd97ca6ed5
commit 82705536c2
3 changed files with 189 additions and 193 deletions

View File

@@ -13,6 +13,13 @@ fi
ln -s "$PWD/zsh/.zshrc" "$ZSHFILE"
POSHDIR="$HOME/.config/ohmyposh"
if [ -f "$POSHDIR" ] || [ -d "$POSHDIR"]; then
mv "$POSHDIR" "$POSHDIR.old"
fi
ln -s "$PWD/zsh/ohmyposh/" "$POSHDIR"
#############################
# kitty
#############################

View File

@@ -1,91 +1,47 @@
# If you come from bash you might have to change your $PATH.
# export PATH="$HOME/.cargo/bin:$HOME/bin:/usr/local/bin:$HOME/.local/bin:$PATH"
#############################
#
# Matthew's zshrc
#
#############################
#############################
# Global Variables
source "$HOME/.cargo/env"
export PATH="$PATH:/home/mattr/.local/bin"
export projects="/media/shared/Projects/"
export classes=$(eza --absolute -1 $HOME/Documents/Classes | sort -t_ -k 1,1 -k 2,2r | tail -n 1)
export steam_loc="$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/compatdata"
export EDITOR="/usr/bin/nvim"
# Set name of the theme to load --- if set to "random", it will
# 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
# Theme
ZSH_THEME="xiong-chiamiov"
# 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/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
zsh-autosuggestions
common-aliases
# ripgrep
zoxide
qrcode
pip
rust
# git
sudo
zsh-syntax-highlighting
zsh-autosuggestions
common-aliases
# ripgrep
zoxide
qrcode
pip
rust
# git
sudo
zsh-syntax-highlighting
)
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $ZSH/oh-my-zsh.sh
# User configuration
# syntax color definition
################################################################################
# Colours
# Syntax Color Definition
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
typeset -A ZSH_HIGHLIGHT_STYLES
@@ -116,33 +72,8 @@ ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=009
ZSH_HIGHLIGHT_STYLES[assign]=none
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias'
################################################################################
# Colours
# Generated using https://dom111.github.io/grep-colors
GREP_COLORS='sl=49;39:cx=49;39:mt=49;31;1:fn=49;32:ln=49;33:bn=49;33:se=1;36'
#GREP_OPTIONS='--color=auto' # Deprecated
# and https://geoff.greer.fm/lscolors/
LS_COLORS='di=36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43'
@@ -150,18 +81,6 @@ LSCOLORS=gxfxcxdxbxegedabagacad
export GREP_COLORS LS_COLORS LSCOLORS
# Check for dircolors and if found, process .dircolors
# This sets up colours for 'ls' via LS_COLORS
if [[ -z "${LS_COLORS}" ]] && get_command dircolors; then
if [[ -r ~/.dircolors ]]; then
eval "$(dircolors -b ~/.dircolors)"
elif [[ -r /etc/DIR_COLORS ]] ; then
eval "$(dircolors -b /etc/DIR_COLORS)"
else
eval "$(dircolors -b)"
fi
fi
LESS_TERMCAP_mb=$'\E[01;31m'
LESS_TERMCAP_md=$'\E[01;38;5;74m'
LESS_TERMCAP_me=$'\E[0m'
@@ -177,6 +96,8 @@ export LESS_TERMCAP_so LESS_TERMCAP_ue LESS_TERMCAP_us
eval "$(zoxide init zsh --cmd cd)"
eval "$(fzf --zsh)"
eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/ohmyposh.toml)"
alias update-grub=' grub2-mkconfig -o /boot/grub2/grub.cfg'
@@ -192,7 +113,6 @@ alias ll='eza -lh'
alias py='python3'
# Gui Interaction
alias open='xdg-open'
# xclip is for x11
@@ -208,104 +128,97 @@ alias tclasses='tmux attach -t classes'
# Custom Functions
fuck () {
TF_PYTHONIOENCODING=$PYTHONIOENCODING;
export TF_SHELL=zsh;
export TF_ALIAS=fuck;
TF_SHELL_ALIASES=$(alias);
export TF_SHELL_ALIASES;
TF_HISTORY="$(fc -ln -10)";
export TF_HISTORY;
export PYTHONIOENCODING=utf-8;
TF_CMD=$(
thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
) && eval $TF_CMD;
unset TF_HISTORY;
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
test -n "$TF_CMD" && print -s $TF_CMD
TF_PYTHONIOENCODING=$PYTHONIOENCODING;
export TF_SHELL=zsh;
export TF_ALIAS=fuck;
TF_SHELL_ALIASES=$(alias);
export TF_SHELL_ALIASES;
TF_HISTORY="$(fc -ln -10)";
export TF_HISTORY;
export PYTHONIOENCODING=utf-8;
TF_CMD=$(
thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
) && eval $TF_CMD;
unset TF_HISTORY;
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
test -n "$TF_CMD" && print -s $TF_CMD
}
function extract()
{
if [ -f $1 ] ; then
case $1 in
*.tar.bz2)
tar xvjf $1
;;
*.tar.gz)
tar xvzf $1
;;
*.bz2)
bunzip2 $1
;;
*.rar)
unrar x $1
;;
*.gz)
gunzip $1
;;
*.tar)
tar xvf $1
;;
*.tbz2)
tar xvjf $1
;;
*.tgz)
tar xvzf $1
;;
*.zip)
unzip $1
;;
*.xz)
unxz $1
;;
*.Z)
uncompress $1
;;
*.7z)
7z x $1
;;
*)
echo "'$1' cannot be extracted via extract"
;;
esac
else
echo "'$1' is not a valid file"
fi
if [ -f $1 ] ; then
case $1 in
*.tar.bz2)
tar xvjf $1
;;
*.tar.gz)
tar xvzf $1
;;
*.bz2)
bunzip2 $1
;;
*.rar)
unrar x $1
;;
*.gz)
gunzip $1
;;
*.tar)
tar xvf $1
;;
*.tbz2)
tar xvjf $1
;;
*.tgz)
tar xvzf $1
;;
*.zip)
unzip $1
;;
*.xz)
unxz $1
;;
*.Z)
uncompress $1
;;
*.7z)
7z x $1
;;
*)
echo "'$1' cannot be extracted via extract"
;;
esac
else
echo "'$1' is not a valid file"
fi
}
forget () {
print "Forgetting last line with '$@'. Please reload shell after compeletion."
print "Forgetting last line with '$@'. Please reload shell after compeletion."
temp=$(mktemp)
temp=$(mktemp)
sed -e '$ d' ~/.zsh_history | tac | awk "!/$@/ || f++" | tac > $temp
print "Difference between .zsh_history and new .zsh_history"
diff ~/.zsh_history $temp
sed -e '$ d' ~/.zsh_history | tac | awk "!/$@/ || f++" | tac > $temp
print "Difference between .zsh_history and new .zsh_history"
diff ~/.zsh_history $temp
mv $temp ~/.zsh_history
mv $temp ~/.zsh_history
if [ -f $temp ]; then
rm -f $temp
fi
if [ -f $temp ]; then
rm -f $temp
fi
}
forgetall () {
print "Forgetting all lines with '$@'. Please reload shell after compeletion."
print "Forgetting all lines with '$@'. Please reload shell after compeletion."
temp=$(mktemp)
sed "/$@/d" ~/.zsh_history > $temp
print "Difference between .zsh_history and new .zsh_history"
diff ~/.zsh_history $temp
mv $temp ~/.zsh_history
temp=$(mktemp)
sed "/$@/d" ~/.zsh_history > $temp
print "Difference between .zsh_history and new .zsh_history"
diff ~/.zsh_history $temp
mv $temp ~/.zsh_history
if [ -f $temp ]; then
rm -f $temp
fi
if [ -f $temp ]; then
rm -f $temp
fi
}
#######################################################################
# Additional Program Hot Fixes
# Fixes Java UI, make sure not to be using headless Java
# export DISPLAY=:0.0

View File

@@ -0,0 +1,76 @@
version = 2
final_space = true
console_title_template = '{{ .Shell }} in {{ .Folder }}'
[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true
[[blocks.segments]]
type = 'path'
style = 'plain'
background = 'transparent'
foreground = 'blue'
template = "{{ .Path }}"
[blocks.segments.properties]
style = 'full'
[[blocks.segments]]
type = 'git'
style = 'plain'
foreground = '#6c6c6c'
background = 'transparent'
template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} <cyan>{{ if gt .Behind 0 }}⇣{{end}}{{ if gt .Ahead 0 }}⇡{{end}}</>'
[blocks.segments.properties]
branch_icon = ''
commit_icon = '@'
fetch = true
[[blocks]]
type = 'rprompt'
overflow = 'hidden'
[[blocks.segments]]
type = 'executiontime'
style = 'plain'
foreground = 'yellow'
background = 'transparent'
template = '{{ .FormattedMs }}'
[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true
[[blocks.segments]]
type = 'text'
style = 'plain'
foreground_templates = [
"{{if gt .Code 0}}red{{end}}",
"{{if eq .Code 0}}magenta{{end}}"
]
background = 'transparent'
template = '<b></b>'
[transient_prompt]
foreground = 'magenta'
background = 'transparent'
template = ' '
[secondary_prompt]
foreground = 'magenta'
background = 'transparent'
template = ' '
[palette]
black = '#262B44'
blue = '#4B95E9'
green = '#59C9A5'
orange = '#F07623'
red = '#D81E5B'
white = '#E0DEF4'
yellow = '#F3AE35'
cyan = '#70C9A5'