[shell] Create the setup.sh

This commit is contained in:
Anas Elgarhy 2023-05-17 10:14:36 +03:00
parent efb569a435
commit f4a5a15a8e
No known key found for this signature in database
GPG Key ID: 0501802A1D496528
3 changed files with 27 additions and 15 deletions

View File

@ -1,6 +1,7 @@
source "$HOME/.config/shell/public-env.sh"
source "$HOME/.config/shell/aliases.sh"
source "$HOME/.config/shell/utils.sh"
source "$HOME/.config/shell/setup.sh"
PS1='[\u@\h \W]\$ '
@ -24,8 +25,3 @@ HISTSIZE=1000000000
SAVEHIST=1000000000
HISTFILE=~/.shell_history
# Auto run
echo "Don't worry I'm here for you <3"
eval "$(github-copilot-cli alias -- "$0")" # Setup the github-copilot-cli alias `??`
# eval "$(starship init bash)"
# eval "$(oh-my-posh init bash --config ~/.config/ohmyposh/1_shell.omp.json)"

25
.config/shell/setup.sh Normal file
View File

@ -0,0 +1,25 @@
PROMPT=ohmyposh
# Fix cava not showing bars
LC_MESSAGES=en_US.UTF-8
LANGUAGE=en_US
LANG=en_US.UTF-8
# Enable the autojump
[[ -s /etc/profile.d/autojump.sh ]] && source /etc/profile.d/autojump.sh
# Setup the github-copilot-cli alias `??`
if command -v github-copilot-cli >/dev/null 2>&1; then
eval "$(github-copilot-cli alias -- "$0")"
fi
# The prompt
if command -v oh-my-posh >/dev/null 2>&1 && [[ $PROMPT == "ohmyposh" ]]; then
eval "$(oh-my-posh init $(basename $SHELL) --config ~/.config/ohmyposh/1_shell.omp.json)"
fi
if command -v starship >/dev/null 2>&1 && [[ $PROMPT == "starship" ]]; then
eval "$(starship init $(basename $SHELL))"
fi
# Auto run
echo "Don't worry I'm here for you <3"

11
.zshrc
View File

@ -1,6 +1,7 @@
source "$HOME/.config/shell/public-env.sh"
source "$HOME/.config/shell/aliases.sh"
source "$HOME/.config/shell/utils.sh"
source "$HOME/.config/shell/setup.sh"
USE_POWERLINE="true"
setopt correct # Auto corect mistakes
@ -108,13 +109,3 @@ bindkey '^[[B' history-substring-search-down
# exec tmux
# fi
# Fix cava not showing bars
LC_MESSAGES=en_US.UTF-8
LANGUAGE=en_US
LANG=en_US.UTF-8
# Auto run
echo "Don't worry I'm here for you <3"
eval "$(github-copilot-cli alias -- "$0")" # Setup the github-copilot-cli alias `??`
# eval "$(starship init zsh)"
eval "$(oh-my-posh init zsh --config ~/.config/ohmyposh/1_shell.omp.json)"