diff --git a/polyjuice.sh b/polyjuice.sh index 77e14b3..7192235 100644 --- a/polyjuice.sh +++ b/polyjuice.sh @@ -18,9 +18,12 @@ if [ "$1" = "zsh" ]; then if [ "$i" = "install" ]; then echo "Installing Oh My Zsh..." zsh "$current_dir/zsh/install_ohmyzsh.sh" - elif [ "$i" = "config" ]; then + elif [ "$i" = "ohmyzsh" ]; then echo "Config Oh My Zsh..." zsh "$current_dir/zsh/config_ohmyzsh.sh" + elif [ "$i" = "starship" ]; then + echo "Config Starship..." + zsh "$current_dir/zsh/config_starship.sh" elif [ "$i" = "p10k" ]; then echo "config powerlevel10k..." zsh "$current_dir/zsh/config_p10k.sh" @@ -31,4 +34,5 @@ if [ "$1" = "zsh" ]; then done fi echo "Run \"exec zsh\" to apply changes." + exec zsh fi diff --git a/starship/starship.toml b/starship/starship.toml new file mode 100644 index 0000000..222213b --- /dev/null +++ b/starship/starship.toml @@ -0,0 +1,185 @@ +# "$schema" = 'https://starship.rs/config-schema.json' + +format = """ +[](color_orange)\ +$os\ +$username\ +$hostname\ +[](bg:color_yellow fg:color_orange)\ +$directory\ +[](fg:color_yellow bg:color_aqua)\ +$git_branch\ +$git_status\ +[](fg:color_aqua bg:color_blue)\ +$c\ +$rust\ +$golang\ +$nodejs\ +$php\ +$java\ +$kotlin\ +$haskell\ +$python\ +[](fg:color_blue bg:color_bg3)\ +$docker_context\ +$conda\ +[](fg:color_bg3 bg:color_bg1)\ +$time\ +$cmd_duration\ +[ ](fg:color_bg1)\ +$line_break$\ +character""" + +palette = 'gruvbox_dark' + +[palettes.gruvbox_dark] +color_fg0 = '#fbf1c7' +color_bg1 = '#3c3836' +color_bg3 = '#665c54' +color_blue = '#458588' +color_aqua = '#689d6a' +color_green = '#98971a' +color_orange = '#d65d0e' +color_purple = '#b16286' +color_red = '#cc241d' +color_yellow = '#d79921' + +[os] +disabled = false +style = "bg:color_orange fg:color_fg0" + +[os.symbols] +Windows = "󰍲" +Ubuntu = "󰕈" +SUSE = "" +Raspbian = "󰐿" +Mint = "󰣭" +Macos = "󰀵" +Manjaro = "" +Linux = "󰌽" +Gentoo = "󰣨" +Fedora = "󰣛" +Alpine = "" +Amazon = "" +Android = "" +Arch = "󰣇" +Artix = "󰣇" +EndeavourOS = "" +CentOS = "" +Debian = "󰣚" +Redhat = "󱄛" +RedHatEnterprise = "󱄛" +Pop = "" + +[username] +show_always = true +style_user = "bg:color_orange fg:color_fg0" +style_root = "bg:color_orange fg:color_fg0" +format = '[ $user ]($style)' + +[hostname] +style = "bg:color_orange fg:color_fg0" +ssh_only = false +format = '[@$ssh_symbol$hostname ]($style)' +aliases = { "DESKTOP-GD7R6G4" = "Main", "DESKTOP-NDHG1UL" = "LabPC" } + +[directory] +style = "fg:color_fg0 bg:color_yellow" +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" + +[directory.substitutions] +"Documents" = "󰈙 " +"Downloads" = " " +"Music" = "󰝚 " +"Pictures" = " " +"Developer" = "󰲋 " + +[git_branch] +symbol = "" +style = "bg:color_aqua" +format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)' + +[git_status] +style = "bg:color_aqua" +format = '[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)' + +[nodejs] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[c] +symbol = " " +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[rust] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[golang] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[php] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[java] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[kotlin] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[haskell] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[python] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[docker_context] +symbol = "" +style = "bg:color_bg3" +format = '[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)' + +[conda] +style = "bg:color_bg3" +format = '[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)' + +[time] +disabled = false +time_format = "%R" +style = "bg:color_bg1" +format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)' + +[cmd_duration] +disabled = false +min_time = 0 +show_milliseconds = true +style = "bg:color_bg1" +format = '[[  $duration ](fg:color_fg0 bg:color_bg1)]($style)' + +[line_break] +disabled = false + +# [character] +# disabled = false +# success_symbol = '[](bold fg:color_green)' +# error_symbol = '[](bold fg:color_red)' +# vimcmd_symbol = '[](bold fg:color_green)' +# vimcmd_replace_one_symbol = '[](bold fg:color_purple)' +# vimcmd_replace_symbol = '[](bold fg:color_purple)' +# vimcmd_visual_symbol = '[](bold fg:color_yellow)' diff --git a/zsh/config_starship.sh b/zsh/config_starship.sh new file mode 100644 index 0000000..be34b8d --- /dev/null +++ b/zsh/config_starship.sh @@ -0,0 +1,5 @@ +#! /bin/bash + +current_dir=$(dirname "$0") + +cp "$current_dir/../starship/starship.toml" "$HOME/.config/" diff --git a/zsh/install_ohmyzsh.sh b/zsh/install_ohmyzsh.sh index 6949942..fa5ac1f 100644 --- a/zsh/install_ohmyzsh.sh +++ b/zsh/install_ohmyzsh.sh @@ -27,6 +27,11 @@ if ! command -v python >/dev/null 2>&1; then exit 1 fi +if ! command -v starship >/dev/null 2>&1; then + echo "Starship is not installed." + exit 1 +fi + # Path PATH_OHMYZSH="$HOME"/.oh-my-zsh PATH_OHMYZSH_CUSTOM_PLUGINS="$PATH_OHMYZSH"/custom/plugins diff --git a/zsh/zshrc b/zsh/zshrc index 9df821c..9b2df34 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,10 +1,3 @@ -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi - # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH @@ -117,9 +110,4 @@ source $ZSH/oh-my-zsh.sh # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" - -# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh -typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0 -typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=2 -typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_CONTENT_EXPANSION='${$((P9K_COMMAND_DURATION_SECONDS < 1 ? int(1000 * P9K_COMMAND_DURATION_SECONDS) : -1)):/-1/$P9K_CONTENT}${${$((P9K_COMMAND_DURATION_SECONDS < 1)):/1/ms}:/0/}' \ No newline at end of file +eval "$(starship init zsh)"