From f4a5a15a8e85b02c558e96494360b704492644f0 Mon Sep 17 00:00:00 2001 From: Anas Elgarhy Date: Wed, 17 May 2023 10:14:36 +0300 Subject: [PATCH] [shell] Create the setup.sh --- .bashrc | 6 +----- .config/shell/setup.sh | 25 +++++++++++++++++++++++++ .zshrc | 11 +---------- 3 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 .config/shell/setup.sh diff --git a/.bashrc b/.bashrc index 4aa85bd..576745c 100644 --- a/.bashrc +++ b/.bashrc @@ -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)" diff --git a/.config/shell/setup.sh b/.config/shell/setup.sh new file mode 100644 index 0000000..a86f8b0 --- /dev/null +++ b/.config/shell/setup.sh @@ -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" diff --git a/.zshrc b/.zshrc index c6b00a5..9e0fa91 100644 --- a/.zshrc +++ b/.zshrc @@ -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)"