Skip to content

Commit

Permalink
feat: support powerline style in starship
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Sep 10, 2024
1 parent 229bb06 commit 1467b3c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 10 deletions.
15 changes: 9 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,22 @@ clean_dotfiles() {
.zshenv
.zshrc
.zshrc.local
starship.toml
"
for c in ${confs}; do
[ -f $HOME/${c} ] && mv $HOME/${c} $HOME/${c}.bak
done

if [ -f $HOME/.config/starship.toml ]; then
mv $HOME/.config/starship.toml $HOME/.config/starship.toml.bak
fi

[ -d $EMACSD ] && mv $EMACSD $EMACSD.bak

rm -rf $ZSH $TMUX $DOTFILES

rm -f $HOME/.gitignore_global $HOME/.gitconfig_global
rm -f $HOME/.tmux.conf $HOME/.tmux.local
rm -f $HOME/.gitignore_global
rm -f $HOME/.tmux.conf
}

YES=0
Expand Down Expand Up @@ -168,10 +173,7 @@ if is_mac && ! command -v brew >/dev/null 2>&1; then
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@HEAD/install.sh)"

# Tap cask and cask-upgrade
brew tap homebrew/cask
brew tap homebrew/cask-versions
brew tap homebrew/cask-fonts
# Tap cask-upgrade
brew tap buo/cask-upgrade

# Install GNU utilities
Expand Down Expand Up @@ -218,6 +220,7 @@ ln -sf $DOTFILES/.zshrc $HOME/.zshrc
ln -sf $DOTFILES/.vimrc $HOME/.vimrc
ln -sf $DOTFILES/.tmux.conf.local $HOME/.tmux.conf.local
ln -sf $DOTFILES/.markdownlintrc $HOME/.markdownlintrc
ln -sf $DOTFILES/starship.toml $HOME/.config/starship.toml

cp -u $DOTFILES/.npmrc $HOME/.npmrc
cp -u $DOTFILES/.gemrc $HOME/.gemrc
Expand Down
4 changes: 0 additions & 4 deletions install_brew_cask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ function check {

xcode-select --install
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@HEAD/install.sh)"

brew tap homebrew/cask
brew tap homebrew/cask-versions
brew tap homebrew/cask-fonts
brew tap buo/cask-upgrade
fi
}
Expand Down
51 changes: 51 additions & 0 deletions starship.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
format = """\
[](bg:#030B16 fg:#7DF9AA)\
[󰀵 ](bg:#7DF9AA fg:#090c0c)\
[](fg:#7DF9AA bg:#1C3A5E)\
$time\
[](fg:#1C3A5E bg:#3B76F0)\
$directory\
[](fg:#3B76F0 bg:#FCF392)\
$git_branch\
$git_status\
$git_metrics\
[](fg:#FCF392 bg:#030B16)\
$character\
"""

[directory]
format = "[ ﱮ $path ]($style)"
style = "fg:#E4E4E4 bg:#3B76F0"

[git_branch]
format = '[ $symbol$branch(:$remote_branch) ]($style)'
symbol = "  "
style = "fg:#1C3A5E bg:#FCF392"

[git_status]
format = '[$all_status]($style)'
style = "fg:#1C3A5E bg:#FCF392"

[git_metrics]
format = "([+$added]($added_style))[]($added_style)"
added_style = "fg:#1C3A5E bg:#FCF392"
deleted_style = "fg:bright-red bg:235"
disabled = false

[hg_branch]
format = "[ $symbol$branch ]($style)"
symbol = ""

[cmd_duration]
format = "[  $duration ]($style)"
style = "fg:bright-white bg:18"

[character]
success_symbol = '[ ➜](bold green) '
error_symbol = '[ ✗](#E84D44) '

[time]
disabled = false
time_format = "%R" # Hour:Minute Format
style = "bg:#1d2230"
format = '[[ 󱑍 $time ](bg:#1C3A5E fg:#8DFBD2)]($style)'

0 comments on commit 1467b3c

Please sign in to comment.