Last active
August 10, 2021 19:02
-
-
Save gedzeppelin/9a69a6d1c5392619dff6097a069c3e18 to your computer and use it in GitHub Desktop.
Simple zsh theme.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Functions | |
git_prompt_info() { | |
inside_git_repo="$(git rev-parse --is-inside-work-tree 2>/dev/null)" | |
if [ "$inside_git_repo" ]; then | |
branch=$(git branch | awk '/^\*/ { print $2 }') | |
echo "%{$RESET%}, in %{$GREEN%}$branch%{$RESET%} branch" | |
else | |
echo "" | |
fi; | |
} | |
get_dir() { | |
if [ "$(pwd)" = "$(eval echo ~$(id -n -u))" ]; then | |
echo "~/" | |
else | |
echo "%3~" | |
fi; | |
} | |
# Colors | |
RESET=$(echo '\033[0m') | |
BLUE=$(echo '\033[1;38;5;51m') | |
ORANGE=$(echo '\033[1;38;5;215m') | |
VIOLET=$(echo '\033[1;38;5;111m') | |
PINK=$(echo '\033[1;38;5;218m') | |
GREEN=$(echo '\033[1;38;5;119m') | |
RED=$(echo '\033[1;38;5;9m') | |
# Custom prompt | |
PROMPT=$'%(?:%{$GREEN%}:%{$RED%})[%{$BLUE%}%T%(?:%{$GREEN%}:%{$RED%})] %(!.%{$RED%}.%{$ORANGE%})%n%{$RESET%} at %{$VIOLET%}%m$(git_prompt_info) %(?:%{$GREEN%}:%{$RED%})[%{$BLUE%}$(get_dir)%(?:%{$GREEN%}:%{$RED%})] | |
─▶%{$RESET%} ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
sudo apt -y update | |
sudo apt -y install wget git zsh | |
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" "" --unattended | |
sudo chsh -s /usr/bin/zsh $USER | |
wget --backups=1 https://gist.githubusercontent.com/gedzeppelin/9a69a6d1c5392619dff6097a069c3e18/raw/gdzsh.zsh-theme -P $HOME/.oh-my-zsh/custom/themes/ | |
sed -i 's/ZSH_THEME=".*"/ZSH_THEME="gdzsh"/' $HOME/.zshrc | |
exec zsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
sudo pacman -Sy wget git zsh --noconfirm | |
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" "" --unattended | |
sudo chsh -s /usr/bin/zsh $USER | |
wget --backups=1 https://gist.githubusercontent.com/gedzeppelin/9a69a6d1c5392619dff6097a069c3e18/raw/gdzsh.zsh-theme -P $HOME/.oh-my-zsh/custom/themes/ | |
sed -i 's/ZSH_THEME=".*"/ZSH_THEME="gdzsh"/' $HOME/.zshrc | |
exec zsh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment