tide/install.fish

97 lines
3.3 KiB
Fish
Raw Normal View History

function lean_install
echo "Installing lean theme..."
2020-04-03 03:12:55 +03:00
# -----------------Download Functions-----------------
set -l tempDir "/tmp/lean_theme"
2020-04-03 02:30:40 +03:00
# Clone repository into $tempDir
if test -e $tempDir
rm -rf $tempDir
end
git clone -q --depth=1 https://github.com/IlanCosman/lean.git $tempDir
# Remove unnecessary files
rm "$tempDir/install.fish"
2020-04-29 19:53:39 +03:00
rm "$tempDir/LICENSE"
rm "$tempDir/README.md"
rm -rf "$tempDir/.git/"
2020-04-16 11:48:40 +03:00
# Copy directory contents into $__fish_config_dir and cleanup
cp -rf "$tempDir/." $__fish_config_dir
rm -rf $tempDir
2020-04-16 11:48:40 +03:00
# ----------------Set Theme Variables----------------
# --------------Colors--------------
set -U lean_color_green 5FD700
set -U lean_color_light_blue 00AFFF
set -U lean_color_dark_blue 0087AF
set -U lean_color_gold D7AF00
# ---------------Pwd---------------
set -U lean_pwd_shorten_margin 5
2020-04-29 22:32:59 +03:00
set -U lean_pwd_unwritable_icon "" # Lock
# ------------Git prompt------------
set -U __fish_git_prompt_show_informative_status true
set -U __fish_git_prompt_showstashstate true
# -------Symbols-------
set -U __fish_git_prompt_char_stateseparator ""
set -U __fish_git_prompt_char_cleanstate ""
set -U __fish_git_prompt_char_upstream_ahead " ⇡"
set -U __fish_git_prompt_char_upstream_behind " ⇣"
set -U __fish_git_prompt_char_stagedstate " +"
2020-04-29 22:32:59 +03:00
set -U __fish_git_prompt_char_dirtystate " !"
set -U __fish_git_prompt_char_untrackedfiles " ?"
set -U __fish_git_prompt_char_stashstate " *"
# --------Colors--------
set -U __fish_git_prompt_color_branch $lean_color_green
set -U __fish_git_prompt_color_upstream $lean_color_green
set -U __fish_git_prompt_color_stagedstate $lean_color_gold
set -U __fish_git_prompt_color_dirtystate $lean_color_gold
set -U __fish_git_prompt_color_untrackedfiles $lean_color_light_blue
set -U __fish_git_prompt_color_stashstate $lean_color_green
2020-04-03 02:30:40 +03:00
2020-04-28 01:37:08 +03:00
# ----------------Right Prompt Items----------------
2020-04-29 22:32:59 +03:00
set -U lean_right_prompt_items "status" "timer" "context" "jobs"
# --------------Status--------------
set -U lean_status_success_icon "✔"
set -U lean_status_success_color 5FAF00
set -U lean_status_failure_icon "✘"
set -U lean_status_failure_color D70000
2020-04-25 22:21:09 +03:00
# --------------Timer--------------
set -U lean_timer_color 87875F
set -U lean_timer_decimals 0
set -U lean_timer_duration 3
# -------------Context-------------
set -U lean_context_ssh_color D7AF87
set -U lean_context_root_color D7AF00
# ---------------Jobs---------------
2020-04-29 22:32:59 +03:00
set -U lean_jobs_icon "" # Gear
set -U lean_jobs_color 5FAF00
2020-04-25 22:21:09 +03:00
# -----------------------Finish-----------------------
source "$__fish_config_dir/functions/fish_prompt.fish"
2020-04-03 03:12:55 +03:00
set_color $lean_color_green
echo "Lean theme installed!"
set_color $fish_color_normal
2020-04-28 02:38:17 +03:00
if _user_confirm_defaultYes "Configure lean prompt?"
lean_wizard
else
echo -e "\n""Run lean_wizard to configure your prompt."
end
end
function _user_confirm_defaultYes -a question
while true
read -P "$question [Y/n] " input
switch $input
case y Y yes Yes
return 0
case n N no No
return 1
2020-04-29 22:32:59 +03:00
case ""
return 0
end
end
end