tide/functions/lean_uninstall.fish

66 lines
2.4 KiB
Fish
Raw Normal View History

2020-04-13 01:40:49 +03:00
function lean_uninstall
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-15 03:52:21 +03:00
echo "Uninstalling lean theme..."
2020-04-28 02:38:17 +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"
end
2020-04-28 01:37:08 +03:00
set -l leanFunctions git_prompt load_right_prompt_items pwd right_prompt uninstall wizard
for func in $leanFunctions
rm "$__fish_config_dir/functions/lean_$func.fish"
end
# --------------Erase Theme Variables--------------
2020-04-21 06:35:56 +03:00
# --------------Prompt--------------
set -a rmVars lean_prompt_connection lean_prompt_connection_color
2020-04-15 03:52:21 +03:00
# --------------Colors--------------
set -a rmVars lean_color_{green, light_blue, dark_blue, gold}
2020-04-15 03:52:21 +03:00
# ---------------Pwd---------------
set -a rmVars fish_prompt_pwd_dir_length lean_shorten_pwd_margin
2020-04-15 03:52:21 +03:00
# ------------Git prompt------------
set -a rmVars __fish_git_prompt_{show_informative_status, showstashstate}
2020-04-15 03:52:21 +03:00
# -------Symbols-------
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--------
set -a rmVars __fish_git_prompt_color_{branch, upstream, stagedstate, dirtystate, untrackedfiles, stashstate}
2020-04-28 01:37:08 +03:00
# ----------------Right Prompt Items----------------
set -a rmVars lean_right_prompt_items
# --------------Timer--------------
set -a rmVars lean_timer_{color, decimals, duration}
# ---------------SSH---------------
set -a rmVars lean_context_{ssh_color, root_color}
for var in $rmVars
2020-04-15 03:52:21 +03:00
set -e $var
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."
end
end
function _user_confirm_defaultNo -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
case ''
return 1
end
end
end