tide/functions/lean_uninstall.fish

57 lines
2.0 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-15 03:52:21 +03:00
echo "Uninstalling lean theme..."
2020-04-13 01:40:49 +03:00
# ------------------Remove Files------------------
2020-04-17 07:31:45 +03:00
rm "$__fish_config_dir/functions/fish_prompt.fish"
rm "$__fish_config_dir/functions/lean"*
rm -r "$__fish_config_dir/lean_theme"
2020-04-13 01:40:49 +03:00
# --------------Erase Theme Variables--------------
2020-04-21 06:35:56 +03:00
# --------------Prompt--------------
set -a vars lean_prompt_connection lean_prompt_connection_color
2020-04-15 03:52:21 +03:00
# --------------Colors--------------
set -a vars lean_color_{green, light_blue, dark_blue, gold}
2020-04-15 03:52:21 +03:00
# ---------------Pwd---------------
set -a vars fish_prompt_pwd_dir_length lean_shorten_pwd_margin
2020-04-15 03:52:21 +03:00
# ------------Git prompt------------
set -a vars __fish_git_prompt_{show_informative_status, showstashstate}
2020-04-15 03:52:21 +03:00
# -------Symbols-------
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--------
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-15 03:52:21 +03:00
for var in $vars
set -e $var
end
2020-04-15 03:52:21 +03:00
echo "Lean theme uninstalled. Exiting fish."
sleep 1
exit
else
echo "Aborted uninstall."
end
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
end