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-15 03:52:21 +03:00
|
|
|
echo "Uninstalling lean theme..."
|
2020-04-13 01:40:49 +03:00
|
|
|
|
2020-04-21 22:15:05 +03:00
|
|
|
# ------------------Remove Files------------------
|
2020-04-17 07:31:45 +03:00
|
|
|
rm "$__fish_config_dir/functions/fish_prompt.fish"
|
2020-04-21 22:15:05 +03:00
|
|
|
rm "$__fish_config_dir/functions/lean"*
|
|
|
|
rm -r "$__fish_config_dir/lean_theme"
|
2020-04-13 01:40:49 +03:00
|
|
|
|
2020-04-25 23:32:44 +03:00
|
|
|
# --------------Erase Theme Variables--------------
|
2020-04-21 06:35:56 +03:00
|
|
|
# --------------Prompt--------------
|
2020-04-25 23:32:44 +03:00
|
|
|
set -a vars lean_prompt_connection lean_prompt_connection_color
|
2020-04-15 03:52:21 +03:00
|
|
|
# --------------Colors--------------
|
2020-04-25 23:32:44 +03:00
|
|
|
set -a vars lean_color_{green, light_blue, dark_blue, gold}
|
2020-04-15 03:52:21 +03:00
|
|
|
# ---------------Pwd---------------
|
2020-04-25 23:32:44 +03:00
|
|
|
set -a vars fish_prompt_pwd_dir_length lean_shorten_pwd_margin
|
2020-04-15 03:52:21 +03:00
|
|
|
# ------------Git prompt------------
|
2020-04-25 23:32:44 +03:00
|
|
|
set -a vars __fish_git_prompt_{show_informative_status, showstashstate}
|
2020-04-15 03:52:21 +03:00
|
|
|
# -------Symbols-------
|
2020-04-25 23:32:44 +03:00
|
|
|
set -a vars __fish_git_prompt_char_{stateseparator, cleanstate, upstream_ahead, upstream_behind}
|
|
|
|
set -a vars __fish_git_prompt_char_{stagedstate, dirtystate, untrackedfiles, stashstate}
|
2020-04-15 03:52:21 +03:00
|
|
|
# --------Colors--------
|
2020-04-25 23:32:44 +03:00
|
|
|
set -a vars __fish_git_prompt_color_{branch, upstream, stagedstate, dirtystate, untrackedfiles, stashstate}
|
|
|
|
|
|
|
|
# ----------------Right Prompt Modules----------------
|
|
|
|
set -a vars lean_right_prompt_modules
|
|
|
|
# --------------Timer--------------
|
|
|
|
set -a vars lean_timer_{color, decimals, duration}
|
|
|
|
# ---------------SSH---------------
|
|
|
|
set -a vars lean_ssh_color
|
2020-04-13 02:58:24 +03:00
|
|
|
|
2020-04-15 03:52:21 +03:00
|
|
|
for var in $vars
|
|
|
|
set -e $var
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|
2020-04-15 03:52:21 +03:00
|
|
|
|
|
|
|
echo "Lean theme uninstalled. Exiting fish."
|
|
|
|
sleep 1
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
echo "Aborted uninstall."
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|
2020-04-22 06:06:05 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
function _user_confirm_defaultNo --argument-names 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
|
2020-04-13 02:58:24 +03:00
|
|
|
end
|