2020-04-13 01:40:49 +03:00
|
|
|
function lean_uninstall
|
2020-04-22 06:06:05 +03:00
|
|
|
if _user_confirm_defaultNo "Unininstall lean theme?"
|
2020-04-28 02:38:17 +03:00
|
|
|
set -l fishPrompt "$__fish_config_dir/functions/fish_prompt.fish"
|
2020-04-29 07:19:32 +03:00
|
|
|
|
2020-04-15 03:52:21 +03:00
|
|
|
echo "Uninstalling lean theme..."
|
2020-04-29 07:19:32 +03:00
|
|
|
|
2020-04-21 22:15:05 +03:00
|
|
|
# ------------------Remove Files------------------
|
|
|
|
rm -r "$__fish_config_dir/lean_theme"
|
2020-04-13 01:40:49 +03:00
|
|
|
|
2020-04-28 02:38:17 +03:00
|
|
|
set -l fishPromptFirstLine (head -n 1 $fishPrompt)
|
2020-04-28 01:10:59 +03:00
|
|
|
if test "$fishPromptFirstLine" = "# Created by lean_wizard"
|
2020-04-28 02:38:17 +03:00
|
|
|
rm $fishPrompt
|
|
|
|
source "$__fish_data_dir/functions/fish_prompt.fish"
|
2020-04-26 00:52:39 +03:00
|
|
|
end
|
|
|
|
|
2020-04-28 01:37:08 +03:00
|
|
|
set -l leanFunctions git_prompt load_right_prompt_items pwd right_prompt uninstall wizard
|
2020-04-26 00:52:39 +03:00
|
|
|
for func in $leanFunctions
|
|
|
|
rm "$__fish_config_dir/functions/lean_$func.fish"
|
|
|
|
end
|
|
|
|
|
2020-04-25 23:32:44 +03:00
|
|
|
# --------------Erase Theme Variables--------------
|
2020-04-21 06:35:56 +03:00
|
|
|
# --------------Prompt--------------
|
2020-04-29 07:19:32 +03:00
|
|
|
set -a rmVars lean_prompt_connection_{icon, color}
|
2020-04-15 03:52:21 +03:00
|
|
|
# --------------Colors--------------
|
2020-04-26 00:52:39 +03:00
|
|
|
set -a rmVars lean_color_{green, light_blue, dark_blue, gold}
|
2020-04-15 03:52:21 +03:00
|
|
|
# ---------------Pwd---------------
|
2020-04-29 07:19:32 +03:00
|
|
|
set -a rmVars lean_pwd_{shorten_margin, unwritable_icon}
|
2020-04-15 03:52:21 +03:00
|
|
|
# ------------Git prompt------------
|
2020-04-26 00:52:39 +03:00
|
|
|
set -a rmVars __fish_git_prompt_{show_informative_status, showstashstate}
|
2020-04-15 03:52:21 +03:00
|
|
|
# -------Symbols-------
|
2020-04-26 00:52:39 +03:00
|
|
|
set -a rmVars __fish_git_prompt_char_{stateseparator, cleanstate, upstream_ahead, upstream_behind}
|
|
|
|
set -a rmVars __fish_git_prompt_char_{stagedstate, dirtystate, untrackedfiles, stashstate}
|
2020-04-15 03:52:21 +03:00
|
|
|
# --------Colors--------
|
2020-04-26 00:52:39 +03:00
|
|
|
set -a rmVars __fish_git_prompt_color_{branch, upstream, stagedstate, dirtystate, untrackedfiles, stashstate}
|
2020-04-25 23:32:44 +03:00
|
|
|
|
2020-04-28 01:37:08 +03:00
|
|
|
# ----------------Right Prompt Items----------------
|
|
|
|
set -a rmVars lean_right_prompt_items
|
2020-04-25 23:32:44 +03:00
|
|
|
# --------------Timer--------------
|
2020-04-26 00:52:39 +03:00
|
|
|
set -a rmVars lean_timer_{color, decimals, duration}
|
2020-04-25 23:32:44 +03:00
|
|
|
# ---------------SSH---------------
|
2020-04-28 23:46:40 +03:00
|
|
|
set -a rmVars lean_context_{ssh_color, root_color}
|
2020-04-29 07:19:32 +03:00
|
|
|
# ---------------Jobs---------------
|
|
|
|
set -U lean_jobs_{icon, color}
|
2020-04-13 02:58:24 +03:00
|
|
|
|
2020-04-26 00:52:39 +03:00
|
|
|
for var in $rmVars
|
2020-04-15 03:52:21 +03:00
|
|
|
set -e $var
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|
2020-04-15 03:52:21 +03:00
|
|
|
|
2020-04-28 02:38:17 +03:00
|
|
|
echo "Lean theme uninstalled."
|
2020-04-15 03:52:21 +03:00
|
|
|
else
|
|
|
|
echo "Aborted uninstall."
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|
2020-04-22 06:06:05 +03:00
|
|
|
end
|
|
|
|
|
2020-04-26 00:52:39 +03:00
|
|
|
function _user_confirm_defaultNo -a question
|
2020-04-22 06:06:05 +03:00
|
|
|
while true
|
|
|
|
read -P "$question [y/N] " input
|
|
|
|
|
|
|
|
switch $input
|
|
|
|
case y Y yes Yes
|
|
|
|
return 0
|
|
|
|
case n N no No
|
|
|
|
return 1
|
|
|
|
case ''
|
|
|
|
return 1
|
|
|
|
end
|
|
|
|
end
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|