mirror of
https://github.com/IlanCosman/tide.git
synced 2024-11-23 08:46:51 +03:00
Rename to tide
This commit is contained in:
parent
e3128ba68b
commit
1b2fcb7f42
10
README.md
10
README.md
@ -1,6 +1,6 @@
|
||||
# Lean
|
||||
# Tide
|
||||
|
||||
A minimal Fish theme based on [Powerlevel10k](https://github.com/romkatv/powerlevel10k/)'s lean style.
|
||||
A Fish theme based on [Powerlevel10k](https://github.com/romkatv/powerlevel10k/).
|
||||
|
||||
![Prompt_Connection](/media/images/Prompt_Connection.png)
|
||||
|
||||
@ -9,7 +9,7 @@ A minimal Fish theme based on [Powerlevel10k](https://github.com/romkatv/powerle
|
||||
Run the install script:
|
||||
|
||||
```fish
|
||||
curl -s https://raw.githubusercontent.com/IlanCosman/lean/master/install.fish | source; and lean_install
|
||||
curl -s https://raw.githubusercontent.com/IlanCosman/tide/master/install.fish | source; and tide_install
|
||||
```
|
||||
|
||||
# Features
|
||||
@ -30,7 +30,7 @@ curl -s https://raw.githubusercontent.com/IlanCosman/lean/master/install.fish |
|
||||
|
||||
# Configuration
|
||||
|
||||
Note that all lean variables, unless stated otherwise, begin with the string `lean_`. Thus, for brevity, variables in this section will be denoted as `example_variable` but will actually be `lean_example_variable`.
|
||||
Note that all tide variables, unless stated otherwise, begin with the string `tide_`. Thus, for brevity, variables in this section will be denoted as `example_variable` but will actually be `tide_example_variable`.
|
||||
|
||||
## Colors
|
||||
|
||||
@ -45,7 +45,7 @@ Note that all lean variables, unless stated otherwise, begin with the string `le
|
||||
|
||||
### git prompt
|
||||
|
||||
Lean's git capabilities are inherited from fish's built-in [fish_git_prompt](https://fishshell.com/docs/current/cmds/fish_git_prompt.html). Modify those variables to configure lean's git prompt.
|
||||
Tide's git capabilities are inherited from fish's built-in [fish_git_prompt](https://fishshell.com/docs/current/cmds/fish_git_prompt.html). Modify those variables to configure tide's git prompt.
|
||||
|
||||
### prompt connection
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
function lean_count_left_prompt_height --on-variable lean_left_prompt_items
|
||||
set -l numberOfNewlines (count (string match -a 'newline' $lean_left_prompt_items))
|
||||
set -U lean_left_prompt_height (math 1+$numberOfNewlines)
|
||||
end
|
4
conf.d/tide_count_left_prompt_height.fish
Normal file
4
conf.d/tide_count_left_prompt_height.fish
Normal file
@ -0,0 +1,4 @@
|
||||
function tide_count_left_prompt_height --on-variable tide_left_prompt_items
|
||||
set -l numberOfNewlines (count (string match -a 'newline' $tide_left_prompt_items))
|
||||
set -U tide_left_prompt_height (math 1+$numberOfNewlines)
|
||||
end
|
@ -2,12 +2,12 @@ function local_install -a localRepo
|
||||
if source "$localRepo/install.fish"
|
||||
cp -r "$localRepo/conf.d" $__fish_config_dir
|
||||
cp -r "$localRepo/functions" $__fish_config_dir
|
||||
cp -r "$localRepo/lean_theme" $__fish_config_dir
|
||||
cp -r "$localRepo/tide_theme" $__fish_config_dir
|
||||
cp -r "$localRepo/tests" $__fish_config_dir
|
||||
cp -r "$localRepo/dev/." "$__fish_config_dir/functions"
|
||||
|
||||
_set_lean_defaults
|
||||
_source_lean_functions
|
||||
_set_tide_defaults
|
||||
_source_tide_functions
|
||||
|
||||
# Install fisher and fishtape for testing
|
||||
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
|
||||
|
@ -1,4 +1,4 @@
|
||||
function lean_test
|
||||
function tide_test
|
||||
argparse 'h/help' 'v/verbose' 'a/all' -- $argv
|
||||
|
||||
if set -q _flag_help
|
||||
@ -8,9 +8,9 @@ function lean_test
|
||||
|
||||
set -l testsDir "$__fish_config_dir/tests"
|
||||
|
||||
set -l pending '/tmp/lean_test'
|
||||
set -l failed '/tmp/lean_test_failed'
|
||||
set -l passed '/tmp/lean_test_passed'
|
||||
set -l pending '/tmp/tide_test'
|
||||
set -l failed '/tmp/tide_test_failed'
|
||||
set -l passed '/tmp/tide_test_passed'
|
||||
|
||||
if set -q _flag_all
|
||||
set argv (basename -s '.fish' $testsDir/*)
|
||||
@ -48,7 +48,7 @@ end
|
||||
function _help
|
||||
set -l b (set_color -o)
|
||||
set -l n (set_color normal)
|
||||
set -l g (set_color $lean_color_green)
|
||||
set -l g (set_color $tide_color_green)
|
||||
|
||||
set -l optionList \
|
||||
'v or --verbose' \
|
||||
@ -59,7 +59,7 @@ function _help
|
||||
'run all available tests' \
|
||||
'print this help message'
|
||||
|
||||
echo 'Usage: '$g'lean_test '$n'[options] '$b'[TESTS...]'$n
|
||||
echo 'Usage: '$g'tide_test '$n'[options] '$b'[TESTS...]'$n
|
||||
echo
|
||||
echo 'Options:'
|
||||
echo
|
@ -1,6 +0,0 @@
|
||||
function _lean_jobs
|
||||
if jobs -q
|
||||
set_color $lean_jobs_color
|
||||
printf '%s ' $lean_jobs_icon
|
||||
end
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
function _lean_time
|
||||
set_color $lean_time_color
|
||||
printf '%s ' (date +$lean_time_format)
|
||||
end
|
@ -1,6 +1,6 @@
|
||||
function _lean_cmd_duration
|
||||
if test $CMD_DURATION -gt $lean_cmd_duration_threshold
|
||||
set -l seconds (math --scale=$lean_cmd_duration_decimals "$CMD_DURATION/1000" % 60)
|
||||
function _tide_cmd_duration
|
||||
if test $CMD_DURATION -gt $tide_cmd_duration_threshold
|
||||
set -l seconds (math --scale=$tide_cmd_duration_decimals "$CMD_DURATION/1000" % 60)
|
||||
set -l minutes (math -s0 "$CMD_DURATION/60000" % 60)
|
||||
set -l hours (math -s0 "$CMD_DURATION/3600000" % 60)
|
||||
|
||||
@ -14,7 +14,7 @@ function _lean_cmd_duration
|
||||
set -e hours
|
||||
end
|
||||
|
||||
set_color $lean_cmd_duration_color
|
||||
set_color $tide_cmd_duration_color
|
||||
printf '%s ' {$hours}'h' {$minutes}'m' {$seconds}'s'
|
||||
end
|
||||
end
|
@ -1,9 +1,9 @@
|
||||
function _lean_context
|
||||
function _tide_context
|
||||
if set -q SSH_TTY
|
||||
set_color $lean_context_ssh_color
|
||||
set_color $tide_context_ssh_color
|
||||
printf '%s ' $USER'@'(prompt_hostname)
|
||||
else if test $USER = 'root'
|
||||
set_color $lean_context_root_color
|
||||
set_color $tide_context_root_color
|
||||
printf '%s ' $USER'@'(prompt_hostname)
|
||||
end
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
function _lean_git_prompt
|
||||
function _tide_git_prompt
|
||||
if set -l gitPrompt (fish_git_prompt)
|
||||
|
||||
set -l gitPrompt (string replace '(' '' $gitPrompt)
|
6
functions/_tide_jobs.fish
Normal file
6
functions/_tide_jobs.fish
Normal file
@ -0,0 +1,6 @@
|
||||
function _tide_jobs
|
||||
if jobs -q
|
||||
set_color $tide_jobs_color
|
||||
printf '%s ' $tide_jobs_icon
|
||||
end
|
||||
end
|
@ -1,3 +1,3 @@
|
||||
function _lean_newline
|
||||
function _tide_newline
|
||||
printf '%s' '\n'
|
||||
end
|
@ -1,6 +1,6 @@
|
||||
function _lean_prompt_char
|
||||
function _tide_prompt_char
|
||||
if test $last_status -eq 0
|
||||
set_color $lean_color_green
|
||||
set_color $tide_color_green
|
||||
else
|
||||
set_color $fish_color_error
|
||||
end
|
@ -1,37 +1,37 @@
|
||||
function _lean_pwd
|
||||
function _tide_pwd
|
||||
set -l splitPwd (string split --no-empty '/' (_shorten_pwd))
|
||||
set -l splitPwdLength (count $splitPwd)
|
||||
|
||||
if not test -w $PWD
|
||||
set_color $lean_color_dark_blue
|
||||
printf '%s' {$lean_pwd_unwritable_icon}' '
|
||||
set_color $tide_color_dark_blue
|
||||
printf '%s' {$tide_pwd_unwritable_icon}' '
|
||||
set_color $fish_color_normal
|
||||
end
|
||||
|
||||
if test "$splitPwd[1]" != '~'
|
||||
set_color $lean_color_dark_blue
|
||||
set_color $tide_color_dark_blue
|
||||
printf '%s' '/'
|
||||
set_color $fish_color_normal
|
||||
end
|
||||
|
||||
set_color -o $lean_color_light_blue
|
||||
set_color -o $tide_color_light_blue
|
||||
printf '%s' "$splitPwd[1]"
|
||||
set_color $fish_color_normal
|
||||
|
||||
if test $splitPwdLength -gt 1
|
||||
set_color $lean_color_dark_blue
|
||||
set_color $tide_color_dark_blue
|
||||
printf '%s' '/'
|
||||
set_color $fish_color_normal
|
||||
end
|
||||
|
||||
if test $splitPwdLength -gt 2
|
||||
set_color $lean_color_dark_blue
|
||||
set_color $tide_color_dark_blue
|
||||
printf '%s' (string join '/' $splitPwd[2..-2])'/'
|
||||
set_color $fish_color_normal
|
||||
end
|
||||
|
||||
if test $splitPwdLength -gt 1
|
||||
set_color -o $lean_color_light_blue
|
||||
set_color -o $tide_color_light_blue
|
||||
printf '%s' "$splitPwd[-1]"
|
||||
set_color $fish_color_normal
|
||||
end
|
||||
@ -43,7 +43,7 @@ function _shorten_pwd
|
||||
set -l pwd (string replace $HOME '~' $PWD)
|
||||
set -l colorPwd $pwd
|
||||
set -l splitPwd (string split --no-empty '/' $pwd)
|
||||
set -l targetLength (math $COLUMNS-$lean_pwd_shorten_margin)
|
||||
set -l targetLength (math $COLUMNS-$tide_pwd_shorten_margin)
|
||||
|
||||
set -l index 2
|
||||
while test (string length $pwd) -gt $targetLength
|
||||
@ -51,8 +51,8 @@ function _shorten_pwd
|
||||
set -l currentPartFirstLetter (string sub -l 1 $currentPart)
|
||||
set pwd (string replace $currentPart $currentPartFirstLetter $pwd)
|
||||
|
||||
set -l lilac (set_color $lean_color_lilac)
|
||||
set -l dBlue (set_color $lean_color_dark_blue)
|
||||
set -l lilac (set_color $tide_color_lilac)
|
||||
set -l dBlue (set_color $tide_color_dark_blue)
|
||||
set colorPwd (string replace $currentPart "$lilac"$currentPartFirstLetter"$dBlue" $colorPwd)
|
||||
|
||||
set index (math $index+1)
|
@ -1,14 +1,14 @@
|
||||
function _lean_status
|
||||
function _tide_status
|
||||
if string match -q --invert '0' $last_pipestatus
|
||||
set -l fishPipestatusWithSignal (__fish_pipestatus_with_signal $last_pipestatus)
|
||||
|
||||
if test (count $last_pipestatus) -gt 1 || string match -qe 'SIG' $fishPipestatusWithSignal
|
||||
if test $last_status -eq 0
|
||||
set_color $lean_status_success_color
|
||||
printf '%s ' {$lean_status_success_icon}
|
||||
set_color $tide_status_success_color
|
||||
printf '%s ' {$tide_status_success_icon}
|
||||
else
|
||||
set_color $lean_status_failure_color
|
||||
printf '%s ' {$lean_status_failure_icon}
|
||||
set_color $tide_status_failure_color
|
||||
printf '%s ' {$tide_status_failure_icon}
|
||||
end
|
||||
printf '%s ' (string join '|' (string replace 'SIG' '' $fishPipestatusWithSignal))
|
||||
end
|
4
functions/_tide_time.fish
Normal file
4
functions/_tide_time.fish
Normal file
@ -0,0 +1,4 @@
|
||||
function _tide_time
|
||||
set_color $tide_time_color
|
||||
printf '%s ' (date +$tide_time_format)
|
||||
end
|
@ -1,19 +1,19 @@
|
||||
# Created by lean configure
|
||||
# Created by tide configure
|
||||
function fish_prompt --description 'Write out the prompt'
|
||||
set -g last_pipestatus $pipestatus
|
||||
set -g last_status $status
|
||||
|
||||
if test "$lean_newline" = 'true'
|
||||
if test "$tide_newline" = 'true'
|
||||
printf '%b' '\n'
|
||||
end
|
||||
|
||||
set_color $lean_prompt_connection_color
|
||||
printf "%.s$lean_prompt_connection_icon" (seq $COLUMNS)
|
||||
set_color $tide_prompt_connection_color
|
||||
printf "%.s$tide_prompt_connection_icon" (seq $COLUMNS)
|
||||
set_color $fish_color_normal
|
||||
|
||||
printf '%b' '\r'
|
||||
lean_right_prompt
|
||||
tide_right_prompt
|
||||
|
||||
printf '%b' '\r'
|
||||
lean_left_prompt
|
||||
tide_left_prompt
|
||||
end
|
||||
|
@ -1,12 +0,0 @@
|
||||
function lean -a subcommand
|
||||
set -l leanSubcommand "lean_$subcommand"
|
||||
set -l leanCommands 'configure' 'uninstall' 'help'
|
||||
|
||||
if contains $subcommand $leanCommands
|
||||
source "$lean_dir/functions/$subcommand.fish"
|
||||
$leanSubcommand $argv[2..-1]
|
||||
else
|
||||
lean help
|
||||
end
|
||||
functions -e $leanSubcommand
|
||||
end
|
12
functions/tide.fish
Normal file
12
functions/tide.fish
Normal file
@ -0,0 +1,12 @@
|
||||
function tide -a subcommand
|
||||
set -l tideSubcommand "tide_$subcommand"
|
||||
set -l tideCommands 'configure' 'uninstall' 'help'
|
||||
|
||||
if contains $subcommand $tideCommands
|
||||
source "$tide_dir/functions/$subcommand.fish"
|
||||
$tideSubcommand $argv[2..-1]
|
||||
else
|
||||
tide help
|
||||
end
|
||||
functions -e $tideSubcommand
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
function lean_decolor -a text
|
||||
function tide_decolor -a text
|
||||
set text (string replace -a (set_color normal) '' "$text")
|
||||
set text (string replace -ar '\e\[[0-9;]*m' '' "$text")
|
||||
|
@ -1,5 +1,5 @@
|
||||
function lean_left_prompt
|
||||
for item in lean_{$lean_left_prompt_items}
|
||||
function tide_left_prompt
|
||||
for item in tide_{$tide_left_prompt_items}
|
||||
set -l itemOutput (_$item)
|
||||
printf '%b' "$itemOutput"
|
||||
|
@ -1,29 +1,29 @@
|
||||
function lean_right_prompt
|
||||
function tide_right_prompt
|
||||
set -l splitText (string split '\n' (_fetch_right_prompt_items))
|
||||
set -l printAtEndedRightPromptHeight (count $splitText)
|
||||
|
||||
for thing in $splitText[1..-2]
|
||||
_print_at_end $thing
|
||||
end
|
||||
if test $printAtEndedRightPromptHeight -eq $lean_left_prompt_height
|
||||
set -g lean_right_prompt_fish $splitText[-1]
|
||||
if test $printAtEndedRightPromptHeight -eq $tide_left_prompt_height
|
||||
set -g tide_right_prompt_fish $splitText[-1]
|
||||
set printAtEndedRightPromptHeight (math $printAtEndedRightPromptHeight-1)
|
||||
else
|
||||
_print_at_end $splitText[-1]
|
||||
set -g lean_right_prompt_fish ''
|
||||
set -g tide_right_prompt_fish ''
|
||||
end
|
||||
|
||||
_cursor_up $printAtEndedRightPromptHeight
|
||||
end
|
||||
|
||||
function fish_right_prompt
|
||||
printf '%s' $lean_right_prompt_fish
|
||||
printf '%s' $tide_right_prompt_fish
|
||||
end
|
||||
|
||||
function _fetch_right_prompt_items
|
||||
printf '%s' ' '
|
||||
|
||||
for item in lean_{$lean_right_prompt_items}
|
||||
for item in tide_{$tide_right_prompt_items}
|
||||
set -l itemOutput (_$item)
|
||||
printf '%s' "$itemOutput"
|
||||
|
||||
@ -32,7 +32,7 @@ function _fetch_right_prompt_items
|
||||
end
|
||||
|
||||
function _print_at_end -a text
|
||||
set -l startLocation (math $COLUMNS -(string length (lean_decolor $text)))
|
||||
set -l startLocation (math $COLUMNS -(string length (tide_decolor $text)))
|
||||
_cursor_right $startLocation
|
||||
printf '%s' $text
|
||||
|
102
install.fish
102
install.fish
@ -1,17 +1,17 @@
|
||||
function lean_install
|
||||
echo 'Installing lean theme...'
|
||||
function tide_install
|
||||
echo 'Installing tide theme...'
|
||||
|
||||
# -----------------Download Functions-----------------
|
||||
set -l tempDir '/tmp/lean_theme'
|
||||
set -l tempDir '/tmp/tide_theme'
|
||||
|
||||
# Clone repository into $tempDir
|
||||
if test -e $tempDir
|
||||
rm -rf $tempDir
|
||||
end
|
||||
git clone -q --depth=1 https://github.com/IlanCosman/lean.git $tempDir
|
||||
git clone -q --depth=1 https://github.com/IlanCosman/tide.git $tempDir
|
||||
|
||||
# Remove all files/dirs except functions and lean_theme
|
||||
set -l keepFiles "$tempDir/"{'conf.d', 'functions', 'lean_theme'}
|
||||
# Remove all files/dirs except functions and tide_theme
|
||||
set -l keepFiles "$tempDir/"{'conf.d', 'functions', 'tide_theme'}
|
||||
for file in $tempDir/*
|
||||
if not contains $file $keepFiles
|
||||
rm -rf $file
|
||||
@ -19,54 +19,54 @@ function lean_install
|
||||
end
|
||||
rm -rf "$tempDir/.git"
|
||||
|
||||
# Copy remaining directory contents into $__fish_config_dir and cleanup
|
||||
# Copy remaining directory contents into $__fish_config_dir and ctideup
|
||||
cp -rf "$tempDir/." $__fish_config_dir
|
||||
rm -rf $tempDir
|
||||
|
||||
# --------------------Set Defaults--------------------
|
||||
_set_lean_defaults
|
||||
_set_tide_defaults
|
||||
|
||||
# -----------------------Finish-----------------------
|
||||
_source_lean_functions
|
||||
_source_tide_functions
|
||||
|
||||
set_color $lean_color_green
|
||||
echo 'Lean theme installed!'
|
||||
set_color $tide_color_green
|
||||
echo 'Tide theme installed!'
|
||||
set_color $fish_color_normal
|
||||
|
||||
if _user_confirm_defaultYes 'Configure lean prompt?'
|
||||
lean configure
|
||||
if _user_confirm_defaultYes 'Configure tide prompt?'
|
||||
tide configure
|
||||
else
|
||||
echo
|
||||
echo 'Run lean configure to configure your prompt.'
|
||||
echo 'Run tide configure to configure your prompt.'
|
||||
end
|
||||
end
|
||||
|
||||
function _set_lean_defaults
|
||||
function _set_tide_defaults
|
||||
# ---------------General Theme Variables---------------
|
||||
set -U lean_dir "$__fish_config_dir/lean_theme"
|
||||
set -U lean_newline 'true'
|
||||
set -U tide_dir "$__fish_config_dir/tide_theme"
|
||||
set -U tide_newline 'true'
|
||||
# --------------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
|
||||
set -U lean_color_lilac 8787AF
|
||||
set -U tide_color_green 5FD700
|
||||
set -U tide_color_light_blue 00AFFF
|
||||
set -U tide_color_dark_blue 0087AF
|
||||
set -U tide_color_gold D7AF00
|
||||
set -U tide_color_lilac 8787AF
|
||||
# ---------Prompt Connection---------
|
||||
set -U lean_prompt_connection_color 6C6C6C
|
||||
set -U lean_prompt_connection_icon ' '
|
||||
set -U tide_prompt_connection_color 6C6C6C
|
||||
set -U tide_prompt_connection_icon ' '
|
||||
|
||||
# --------------------Prompt Items--------------------
|
||||
set -U lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
set -U lean_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs'
|
||||
set -U tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
set -U tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs'
|
||||
# ----------------Pwd----------------
|
||||
set -U lean_pwd_shorten_margin 5
|
||||
set -U lean_pwd_unwritable_icon '' # Lock
|
||||
set -U tide_pwd_shorten_margin 5
|
||||
set -U tide_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_ctidestate ''
|
||||
set -U __fish_git_prompt_char_upstream_ahead ' ⇡'
|
||||
set -U __fish_git_prompt_char_upstream_behind ' ⇣'
|
||||
set -U __fish_git_prompt_char_stagedstate ' +'
|
||||
@ -74,37 +74,37 @@ function _set_lean_defaults
|
||||
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
|
||||
set -U __fish_git_prompt_color_branch $tide_color_green
|
||||
set -U __fish_git_prompt_color_upstream $tide_color_green
|
||||
set -U __fish_git_prompt_color_stagedstate $tide_color_gold
|
||||
set -U __fish_git_prompt_color_dirtystate $tide_color_gold
|
||||
set -U __fish_git_prompt_color_untrackedfiles $tide_color_light_blue
|
||||
set -U __fish_git_prompt_color_stashstate $tide_color_green
|
||||
# --------------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
|
||||
set -U tide_status_success_icon '✔'
|
||||
set -U tide_status_success_color 5FAF00
|
||||
set -U tide_status_failure_icon '✘'
|
||||
set -U tide_status_failure_color D70000
|
||||
# -----------Cmd_Duration-----------
|
||||
set -U lean_cmd_duration_color 87875F
|
||||
set -U lean_cmd_duration_decimals 0
|
||||
set -U lean_cmd_duration_threshold 3000
|
||||
set -U tide_cmd_duration_color 87875F
|
||||
set -U tide_cmd_duration_decimals 0
|
||||
set -U tide_cmd_duration_threshold 3000
|
||||
# --------------Context--------------
|
||||
set -U lean_context_ssh_color D7AF87
|
||||
set -U lean_context_root_color D7AF00
|
||||
set -U tide_context_ssh_color D7AF87
|
||||
set -U tide_context_root_color D7AF00
|
||||
# ---------------Jobs---------------
|
||||
set -U lean_jobs_icon '' # Gear
|
||||
set -U lean_jobs_color 5FAF00
|
||||
set -U tide_jobs_icon '' # Gear
|
||||
set -U tide_jobs_color 5FAF00
|
||||
# ---------------Time---------------
|
||||
set -U lean_time_color 5F8787
|
||||
set -U tide_time_color 5F8787
|
||||
end
|
||||
|
||||
function _source_lean_functions
|
||||
source "$__fish_config_dir/conf.d/lean_count_left_prompt_height.fish"
|
||||
source "$__fish_config_dir/conf.d/lean_cursor_movement.fish"
|
||||
function _source_tide_functions
|
||||
source "$__fish_config_dir/conf.d/tide_count_left_prompt_height.fish"
|
||||
source "$__fish_config_dir/conf.d/tide_cursor_movement.fish"
|
||||
source "$__fish_config_dir/functions/fish_prompt.fish"
|
||||
|
||||
lean_count_left_prompt_height
|
||||
tide_count_left_prompt_height
|
||||
end
|
||||
|
||||
function _user_confirm_defaultYes -a question
|
||||
|
@ -1,15 +0,0 @@
|
||||
function fake_prompt
|
||||
if test "$fake_lean_newline" = 'true'
|
||||
printf '\n'
|
||||
end
|
||||
|
||||
set_color $fake_lean_prompt_connection_color
|
||||
printf "%.s$fake_lean_prompt_connection_icon" (seq $fake_columns)
|
||||
set_color $fish_color_normal
|
||||
|
||||
printf '\r'
|
||||
fake_lean_right_prompt
|
||||
|
||||
printf '\r'
|
||||
fake_lean_left_prompt
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
function _fake_lean_cmd_duration
|
||||
set_color $lean_cmd_duration_color
|
||||
printf '%s ' '5s'
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
function _fake_lean_git_prompt
|
||||
set_color $lean_color_green
|
||||
printf '%s ' 'master'
|
||||
end
|
@ -1,3 +0,0 @@
|
||||
function _fake_lean_newline
|
||||
printf '%s' '\n'
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
function _fake_lean_prompt_char
|
||||
set_color $lean_color_green
|
||||
printf '%s ' '❯'
|
||||
end
|
@ -1,14 +0,0 @@
|
||||
function _fake_lean_pwd
|
||||
set_color -o $lean_color_light_blue
|
||||
printf '%s' '~'
|
||||
set_color normal
|
||||
|
||||
set_color $lean_color_dark_blue
|
||||
printf '%s' '/'
|
||||
set_color normal
|
||||
|
||||
set_color -o $lean_color_light_blue
|
||||
printf '%s' 'src'
|
||||
|
||||
printf '%s' ' '
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
function _fake_lean_time
|
||||
set_color $fake_lean_time_color
|
||||
printf '%s ' (date +$fake_lean_time_format)
|
||||
end
|
@ -2,10 +2,10 @@
|
||||
|
||||
function _cmd_duration -a duration threshold decimals
|
||||
set -g CMD_DURATION $duration
|
||||
set -g lean_cmd_duration_threshold $threshold
|
||||
set -g lean_cmd_duration_decimals $decimals
|
||||
set -g tide_cmd_duration_threshold $threshold
|
||||
set -g tide_cmd_duration_decimals $decimals
|
||||
|
||||
lean_decolor (_lean_cmd_duration)
|
||||
tide_decolor (_tide_cmd_duration)
|
||||
end
|
||||
|
||||
@test 'Less than threshold' (_cmd_duration 2000 3000 0) -z
|
||||
|
@ -1,11 +1,11 @@
|
||||
@mesg '-----------context-----------'
|
||||
|
||||
set -l sourceFile "$__fish_config_dir/functions/_lean_context.fish"
|
||||
set -l sourceFile "$__fish_config_dir/functions/_tide_context.fish"
|
||||
|
||||
function _context
|
||||
lean_decolor (_lean_context)
|
||||
tide_decolor (_tide_context)
|
||||
end
|
||||
|
||||
@test 'None' (_context) -z
|
||||
@test 'SSH' (set -g SSH_TTY 'true'; _context) = $USER'@'(prompt_hostname)' '
|
||||
@test 'Root' (lean_decolor (su -c "fish -c 'source $sourceFile;_lean_context'")) = 'root@'(prompt_hostname)' '
|
||||
@test 'Root' (tide_decolor (su -c "fish -c 'source $sourceFile;_tide_context'")) = 'root@'(prompt_hostname)' '
|
@ -1,8 +1,8 @@
|
||||
@mesg '-------------jobs-------------'
|
||||
|
||||
function _jobs
|
||||
lean_decolor (_lean_jobs)
|
||||
tide_decolor (_tide_jobs)
|
||||
end
|
||||
|
||||
@test 'No Jobs' (_jobs) -z
|
||||
@test 'Jobs' (sleep 60 &; _jobs) = "$lean_jobs_icon "
|
||||
@test 'Jobs' (sleep 60 &; _jobs) = "$tide_jobs_icon "
|
@ -2,10 +2,10 @@
|
||||
|
||||
function _pwd -a dir
|
||||
cd $dir
|
||||
lean_decolor (_lean_pwd)
|
||||
tide_decolor (_tide_pwd)
|
||||
end
|
||||
|
||||
set -l unwr "$lean_pwd_unwritable_icon "
|
||||
set -l unwr "$tide_pwd_unwritable_icon "
|
||||
|
||||
@test '/' (_pwd '/') = $unwr'/ '
|
||||
@test '/usr' (_pwd '/usr') = $unwr'/usr '
|
||||
|
@ -3,12 +3,12 @@
|
||||
function _status
|
||||
set -g last_pipestatus $pipestatus
|
||||
set -g last_status $status
|
||||
lean_decolor (_lean_status)
|
||||
tide_decolor (_tide_status)
|
||||
end
|
||||
|
||||
@test 'true' (true; _status) -z
|
||||
@test 'false' (false; _status) -z
|
||||
@test 'true|false' (true|false; _status) = "$lean_status_failure_icon 0|1 "
|
||||
@test 'true|false' (true|false; _status) = "$tide_status_failure_icon 0|1 "
|
||||
@test 'true|true' (true|true; _status) -z
|
||||
@test 'false|true' (false|true; _status) = "$lean_status_success_icon 1|0 "
|
||||
@test 'false|false' (false|false; _status) = "$lean_status_failure_icon 1|1 "
|
||||
@test 'false|true' (false|true; _status) = "$tide_status_success_icon 1|0 "
|
||||
@test 'false|false' (false|false; _status) = "$tide_status_failure_icon 1|1 "
|
@ -1,5 +1,5 @@
|
||||
function finish
|
||||
_title 'Overwrite lean config?'
|
||||
_title 'Overwrite tide config?'
|
||||
|
||||
_option y 'Yes'
|
||||
printf '%b' '\n\n'
|
||||
@ -10,12 +10,12 @@ function finish
|
||||
switch (_menu 'Choice' y/n)
|
||||
case y
|
||||
|
||||
set -U lean_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs'
|
||||
if test -z $lean_time_format
|
||||
set -a lean_right_prompt_items 'time'
|
||||
set -U tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs'
|
||||
if test -z $tide_time_format
|
||||
set -a tide_right_prompt_items 'time'
|
||||
end
|
||||
|
||||
set -l vars lean_{ \
|
||||
set -l vars tide_{ \
|
||||
newline, \
|
||||
left_prompt_items, \
|
||||
prompt_connection_color, prompt_connection_icon, \
|
@ -2,25 +2,25 @@ function prompt_connection
|
||||
_title 'Prompt Connection'
|
||||
|
||||
_option 1 'Disconnected'
|
||||
_display_prompt fake_lean_prompt_connection_icon ' '
|
||||
_display_prompt fake_tide_prompt_connection_icon ' '
|
||||
|
||||
_option 2 'Dotted'
|
||||
_display_prompt fake_lean_prompt_connection_icon '·'
|
||||
_display_prompt fake_tide_prompt_connection_icon '·'
|
||||
|
||||
_option 3 'Solid'
|
||||
_display_prompt fake_lean_prompt_connection_icon '─'
|
||||
_display_prompt fake_tide_prompt_connection_icon '─'
|
||||
|
||||
_display_restart_and_quit
|
||||
|
||||
switch (_menu 'Choice' 1/2/3/r/q)
|
||||
case 1
|
||||
set -g fake_lean_prompt_connection_icon ' '
|
||||
set -g fake_tide_prompt_connection_icon ' '
|
||||
_next_choice 'prompt_spacing'
|
||||
case 2
|
||||
set -g fake_lean_prompt_connection_icon '·'
|
||||
set -g fake_tide_prompt_connection_icon '·'
|
||||
_next_choice 'prompt_connection_color'
|
||||
case 3
|
||||
set -g fake_lean_prompt_connection_icon '─'
|
||||
set -g fake_tide_prompt_connection_icon '─'
|
||||
_next_choice 'prompt_connection_color'
|
||||
case r
|
||||
_begin
|
@ -2,31 +2,31 @@ function prompt_connection_color
|
||||
_title 'Connection Color'
|
||||
|
||||
_option 1 'Lightest'
|
||||
_display_prompt fake_lean_prompt_connection_color 808080
|
||||
_display_prompt fake_tide_prompt_connection_color 808080
|
||||
|
||||
_option 2 'Light'
|
||||
_display_prompt fake_lean_prompt_connection_color 6C6C6C
|
||||
_display_prompt fake_tide_prompt_connection_color 6C6C6C
|
||||
|
||||
_option 3 'Dark'
|
||||
_display_prompt fake_lean_prompt_connection_color 585858
|
||||
_display_prompt fake_tide_prompt_connection_color 585858
|
||||
|
||||
_option 4 'Darkest'
|
||||
_display_prompt fake_lean_prompt_connection_color 444444
|
||||
_display_prompt fake_tide_prompt_connection_color 444444
|
||||
|
||||
_display_restart_and_quit
|
||||
|
||||
switch (_menu 'Choice' 1/2/3/4/r/q)
|
||||
case 1
|
||||
set -g fake_lean_prompt_connection_color 808080
|
||||
set -g fake_tide_prompt_connection_color 808080
|
||||
_next_choice 'prompt_spacing'
|
||||
case 2
|
||||
set -g fake_lean_prompt_connection_color 6C6C6C
|
||||
set -g fake_tide_prompt_connection_color 6C6C6C
|
||||
_next_choice 'prompt_spacing'
|
||||
case 3
|
||||
set -g fake_lean_prompt_connection_color 585858
|
||||
set -g fake_tide_prompt_connection_color 585858
|
||||
_next_choice 'prompt_spacing'
|
||||
case 4
|
||||
set -g fake_lean_prompt_connection_color 444444
|
||||
set -g fake_tide_prompt_connection_color 444444
|
||||
_next_choice 'prompt_spacing'
|
||||
case r
|
||||
_begin
|
@ -2,22 +2,22 @@ function prompt_height
|
||||
_title 'Prompt Height?'
|
||||
|
||||
_option 1 'One line'
|
||||
set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'prompt_char'
|
||||
# fake_lean_count_left_prompt_height
|
||||
set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'prompt_char'
|
||||
# fake_tide_count_left_prompt_height
|
||||
_display_prompt
|
||||
|
||||
_option 2 'Two lines'
|
||||
set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
_display_prompt
|
||||
|
||||
_display_restart_and_quit
|
||||
|
||||
switch (_menu 'Choice' 1/2/r/q)
|
||||
case 1
|
||||
set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'prompt_char'
|
||||
set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'prompt_char'
|
||||
_next_choice 'prompt_spacing'
|
||||
case 2
|
||||
set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
_next_choice 'prompt_connection'
|
||||
case r
|
||||
_begin
|
@ -2,23 +2,23 @@ function prompt_spacing
|
||||
_title 'Prompt Spacing'
|
||||
|
||||
_option 1 'Compact'
|
||||
_display_prompt fake_lean_newline true
|
||||
_display_prompt fake_tide_newline true
|
||||
_cursor_up 1
|
||||
_display_prompt fake_lean_newline false
|
||||
_display_prompt fake_tide_newline false
|
||||
|
||||
_option 2 'Sparse'
|
||||
_display_prompt fake_lean_newline true
|
||||
_display_prompt fake_tide_newline true
|
||||
_cursor_up 1
|
||||
_display_prompt fake_lean_newline true
|
||||
_display_prompt fake_tide_newline true
|
||||
|
||||
_display_restart_and_quit
|
||||
|
||||
switch (_menu 'Choice' 1/2/r/q)
|
||||
case 1
|
||||
set -g fake_lean_newline false
|
||||
set -g fake_tide_newline false
|
||||
_next_choice 'finish'
|
||||
case 2
|
||||
set -g fake_lean_newline true
|
||||
set -g fake_tide_newline true
|
||||
_next_choice 'finish'
|
||||
case r
|
||||
_begin
|
@ -2,25 +2,25 @@ function show_time
|
||||
_title 'Show current time?'
|
||||
|
||||
_option 1 'No'
|
||||
_display_prompt fake_lean_time_format ''
|
||||
_display_prompt fake_tide_time_format ''
|
||||
|
||||
_option 2 '24-hour format'
|
||||
_display_prompt fake_lean_time_format '%T'
|
||||
_display_prompt fake_tide_time_format '%T'
|
||||
|
||||
_option 3 '12-hour format'
|
||||
_display_prompt fake_lean_time_format '%r'
|
||||
_display_prompt fake_tide_time_format '%r'
|
||||
|
||||
_display_restart_and_quit
|
||||
|
||||
switch (_menu 'Choice' 1/2/3/r/q)
|
||||
case 1
|
||||
set -g fake_lean_time_format ''
|
||||
set -g fake_tide_time_format ''
|
||||
_next_choice 'prompt_height'
|
||||
case 2
|
||||
set -g fake_lean_time_format '%T'
|
||||
set -g fake_tide_time_format '%T'
|
||||
_next_choice 'prompt_height'
|
||||
case 3
|
||||
set -g fake_lean_time_format '%r'
|
||||
set -g fake_tide_time_format '%r'
|
||||
_next_choice 'prompt_height'
|
||||
case r
|
||||
_begin
|
@ -1,5 +1,5 @@
|
||||
function fake_lean_left_prompt
|
||||
for item in fake_lean_{$fake_lean_left_prompt_items}
|
||||
function fake_tide_left_prompt
|
||||
for item in fake_tide_{$fake_tide_left_prompt_items}
|
||||
set -l itemOutput (_$item)
|
||||
printf '%b' "$itemOutput"
|
||||
|
@ -1,4 +1,4 @@
|
||||
function fake_lean_right_prompt
|
||||
function fake_tide_right_prompt
|
||||
set -l splitText (string split '\n' (_fetch_right_prompt_items))
|
||||
set -l printAtEndedRightPromptHeight (count $splitText)
|
||||
|
||||
@ -12,7 +12,7 @@ end
|
||||
function _fetch_right_prompt_items
|
||||
printf '%s' ' '
|
||||
|
||||
for item in fake_lean_{$fake_lean_right_prompt_items}
|
||||
for item in fake_tide_{$fake_tide_right_prompt_items}
|
||||
set -l itemOutput (_$item)
|
||||
printf '%s' "$itemOutput"
|
||||
|
||||
@ -21,7 +21,7 @@ function _fetch_right_prompt_items
|
||||
end
|
||||
|
||||
function _print_at_end -a text
|
||||
set -l startLocation (math $fake_columns -(string length (lean_decolor $text)))
|
||||
set -l startLocation (math $fake_columns -(string length (tide_decolor $text)))
|
||||
_cursor_right $startLocation
|
||||
printf '%s' $text
|
||||
|
15
tide_theme/configure/functions/fake_prompt.fish
Normal file
15
tide_theme/configure/functions/fake_prompt.fish
Normal file
@ -0,0 +1,15 @@
|
||||
function fake_prompt
|
||||
if test "$fake_tide_newline" = 'true'
|
||||
printf '\n'
|
||||
end
|
||||
|
||||
set_color $fake_tide_prompt_connection_color
|
||||
printf "%.s$fake_tide_prompt_connection_icon" (seq $fake_columns)
|
||||
set_color $fish_color_normal
|
||||
|
||||
printf '\r'
|
||||
fake_tide_right_prompt
|
||||
|
||||
printf '\r'
|
||||
fake_tide_left_prompt
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
function _fake_tide_cmd_duration
|
||||
set_color $tide_cmd_duration_color
|
||||
printf '%s ' '5s'
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
function _fake_tide_git_prompt
|
||||
set_color $tide_color_green
|
||||
printf '%s ' 'master'
|
||||
end
|
@ -0,0 +1,3 @@
|
||||
function _fake_tide_newline
|
||||
printf '%s' '\n'
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
function _fake_tide_prompt_char
|
||||
set_color $tide_color_green
|
||||
printf '%s ' '❯'
|
||||
end
|
14
tide_theme/configure/prompt_items/_fake_lean_pwd.fish
Normal file
14
tide_theme/configure/prompt_items/_fake_lean_pwd.fish
Normal file
@ -0,0 +1,14 @@
|
||||
function _fake_tide_pwd
|
||||
set_color -o $tide_color_light_blue
|
||||
printf '%s' '~'
|
||||
set_color normal
|
||||
|
||||
set_color $tide_color_dark_blue
|
||||
printf '%s' '/'
|
||||
set_color normal
|
||||
|
||||
set_color -o $tide_color_light_blue
|
||||
printf '%s' 'src'
|
||||
|
||||
printf '%s' ' '
|
||||
end
|
4
tide_theme/configure/prompt_items/_fake_lean_time.fish
Normal file
4
tide_theme/configure/prompt_items/_fake_lean_time.fish
Normal file
@ -0,0 +1,4 @@
|
||||
function _fake_tide_time
|
||||
set_color $fake_tide_time_color
|
||||
printf '%s ' (date +$fake_tide_time_format)
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
function lean_configure
|
||||
function tide_configure
|
||||
if test $COLUMNS -lt 55 || test $LINES -lt 21
|
||||
echo 'Terminal size too small; must be at least 55 x 21'
|
||||
return 1
|
||||
@ -10,10 +10,10 @@ function lean_configure
|
||||
end
|
||||
set -g fake_lines $LINES
|
||||
|
||||
for fn in $lean_dir/configure/functions/*
|
||||
for fn in $tide_dir/configure/functions/*
|
||||
source "$fn"
|
||||
end
|
||||
for promptItem in $lean_dir/configure/prompt_items/*
|
||||
for promptItem in $tide_dir/configure/prompt_items/*
|
||||
source "$promptItem"
|
||||
end
|
||||
|
||||
@ -27,22 +27,22 @@ end
|
||||
|
||||
function _set_defaults
|
||||
if test $fake_lines -ge 26
|
||||
set -g fake_lean_newline true
|
||||
set -g fake_tide_newline true
|
||||
else
|
||||
set -g fake_lean_newline false
|
||||
set -g fake_tide_newline false
|
||||
end
|
||||
|
||||
set -g fake_lean_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
set -g fake_lean_right_prompt_items 'cmd_duration' 'time'
|
||||
set -g fake_tide_left_prompt_items 'pwd' 'git_prompt' 'newline' 'prompt_char'
|
||||
set -g fake_tide_right_prompt_items 'cmd_duration' 'time'
|
||||
|
||||
set -g fake_lean_time_format ''
|
||||
set -g fake_lean_time_color 5F8787
|
||||
set -g fake_lean_prompt_connection_icon ' '
|
||||
set -g fake_lean_prompt_connection_color 6C6C6C
|
||||
set -g fake_tide_time_format ''
|
||||
set -g fake_tide_time_color 5F8787
|
||||
set -g fake_tide_prompt_connection_icon ' '
|
||||
set -g fake_tide_prompt_connection_color 6C6C6C
|
||||
end
|
||||
|
||||
function _next_choice -a nextChoice
|
||||
source "$lean_dir/configure/choices/$nextChoice.fish"
|
||||
source "$tide_dir/configure/choices/$nextChoice.fish"
|
||||
$nextChoice
|
||||
end
|
||||
|
||||
@ -93,7 +93,7 @@ end
|
||||
|
||||
function _quit --on-signal INT
|
||||
source "$__fish_config_dir/functions/fish_prompt.fish"
|
||||
source "$__fish_config_dir/functions/lean_left_prompt.fish"
|
||||
source "$__fish_config_dir/functions/lean_right_prompt.fish"
|
||||
source "$__fish_config_dir/functions/tide_left_prompt.fish"
|
||||
source "$__fish_config_dir/functions/tide_right_prompt.fish"
|
||||
clear
|
||||
end
|
@ -1,7 +1,7 @@
|
||||
function lean_help -a subcommand
|
||||
function tide_help -a subcommand
|
||||
set -g b (set_color -o)
|
||||
set -g n (set_color normal)
|
||||
set -g g (set_color $lean_color_green)
|
||||
set -g g (set_color $tide_color_green)
|
||||
|
||||
set -g subcommandList \
|
||||
'configure' \
|
||||
@ -9,7 +9,7 @@ function lean_help -a subcommand
|
||||
'help'
|
||||
set -g descriptionList \
|
||||
'run interactive configuration wizard' \
|
||||
'uninstall lean theme' \
|
||||
'uninstall tide theme' \
|
||||
'print this help message'
|
||||
|
||||
if contains $subcommand $subcommandList
|
||||
@ -21,7 +21,7 @@ function lean_help -a subcommand
|
||||
return 0
|
||||
end
|
||||
|
||||
echo 'Usage: '$g'lean '$n$b'subcommand '$n'[options]'
|
||||
echo 'Usage: '$g'tide '$n$b'subcommand '$n'[options]'
|
||||
echo
|
||||
echo 'Subcommands:'
|
||||
echo
|
||||
@ -33,7 +33,7 @@ function lean_help -a subcommand
|
||||
echo
|
||||
echo 'Print help for a specific subcommand:'
|
||||
echo
|
||||
echo ' '$g'lean '$n'help '$b'subcommand'$n
|
||||
echo ' '$g'tide '$n'help '$b'subcommand'$n
|
||||
|
||||
set -a rmVars b n g subcommandList descriptionList
|
||||
for var in $rmVars
|
||||
@ -51,7 +51,7 @@ function _generic_help_sub -a subcommand
|
||||
set -l descriptionFirstLetter (string sub -l 1 $description)
|
||||
set -l upperDescriptionFirstLetter (string upper $descriptionFirstLetter)
|
||||
|
||||
echo 'Usage: '$g'lean '$n$b$subcommand$n
|
||||
echo 'Usage: '$g'tide '$n$b$subcommand$n
|
||||
echo
|
||||
string replace $descriptionFirstLetter $upperDescriptionFirstLetter $description
|
||||
end
|
@ -1,70 +1,70 @@
|
||||
function lean_uninstall
|
||||
if not _user_confirm_defaultNo 'Uninstall lean theme?'
|
||||
function tide_uninstall
|
||||
if not _user_confirm_defaultNo 'Uninstall tide theme?'
|
||||
echo 'Aborted uninstall.'
|
||||
return 1
|
||||
end
|
||||
echo 'Uninstalling lean theme...'
|
||||
echo 'Uninstalling tide theme...'
|
||||
|
||||
set -l fishPrompt (functions -D fish_prompt)
|
||||
|
||||
# ----------------------------------Remove Files----------------------------------
|
||||
if test -e $lean_dir
|
||||
rm -r $lean_dir
|
||||
if test -e $tide_dir
|
||||
rm -r $tide_dir
|
||||
end
|
||||
|
||||
set -l fishPromptFirstLine (head -n 1 $fishPrompt)
|
||||
if test "$fishPromptFirstLine" = '# Created by lean configure'
|
||||
if test "$fishPromptFirstLine" = '# Created by tide configure'
|
||||
rm $fishPrompt
|
||||
source "$__fish_data_dir/functions/fish_prompt.fish"
|
||||
end
|
||||
|
||||
set -a leanFunctions 'lean'
|
||||
set -a leanFunctions 'lean_'{'decolor', 'left_prompt', 'right_prompt'}
|
||||
set -a leanFunctions '_lean_'{'cmd_duration', 'context', 'git_prompt', 'jobs', 'newline', 'prompt_char', 'pwd', 'status', 'time'}
|
||||
for func in $leanFunctions
|
||||
set -a tideFunctions 'tide'
|
||||
set -a tideFunctions 'tide_'{'decolor', 'left_prompt', 'right_prompt'}
|
||||
set -a tideFunctions '_tide_'{'cmd_duration', 'context', 'git_prompt', 'jobs', 'newline', 'prompt_char', 'pwd', 'status', 'time'}
|
||||
for func in $tideFunctions
|
||||
rm "$__fish_config_dir/functions/$func.fish"
|
||||
end
|
||||
|
||||
set -a leanConfd 'lean_'{'count_left_prompt_height', 'cursor_movement'}
|
||||
for file in $leanConfd
|
||||
set -a tideConfd 'tide_'{'count_left_prompt_height', 'cursor_movement'}
|
||||
for file in $tideConfd
|
||||
rm "$__fish_config_dir/conf.d/$file.fish"
|
||||
end
|
||||
|
||||
# -----------------------------Erase Theme Variables------------------------------
|
||||
set -l rmVars \
|
||||
# ---------------General Theme Variables---------------
|
||||
'lean'{'dir', 'newline'} \
|
||||
'tide'{'dir', 'newline'} \
|
||||
# --------------Colors--------------
|
||||
'lean_color_'{'green', 'light_blue', 'dark_blue', 'gold', 'lilac'} \
|
||||
'tide_color_'{'green', 'light_blue', 'dark_blue', 'gold', 'lilac'} \
|
||||
# ---------Prompt Connection---------
|
||||
'lean_prompt_connection_'{'icon', 'color'} \
|
||||
'tide_prompt_connection_'{'icon', 'color'} \
|
||||
# --------------------Prompt Items--------------------
|
||||
'lean_'{'right_prompt_items', 'left_prompt_items', 'left_prompt_height'} \
|
||||
'tide_'{'right_prompt_items', 'left_prompt_items', 'left_prompt_height'} \
|
||||
# ----------------Pwd----------------
|
||||
'lean_pwd_'{'shorten_margin', 'unwritable_icon'} \
|
||||
'tide_pwd_'{'shorten_margin', 'unwritable_icon'} \
|
||||
# ------------Git prompt------------
|
||||
'__fish_git_prompt_'{'show_informative_status', 'showstashstate'} \
|
||||
# -------Symbols-------
|
||||
'__fish_git_prompt_char_'{'stateseparator', 'cleanstate', 'upstream_ahead', 'upstream_behind'} \
|
||||
'__fish_git_prompt_char_'{'stateseparator', 'ctidestate', 'upstream_ahead', 'upstream_behind'} \
|
||||
'__fish_git_prompt_char_'{'stagedstate', 'dirtystate', 'untrackedfiles', 'stashstate'} \
|
||||
# --------Colors--------
|
||||
'__fish_git_prompt_color_'{'branch', 'upstream', 'stagedstate', 'dirtystate', 'untrackedfiles', 'stashstate'} \
|
||||
# --------------Status--------------
|
||||
'lean_status_'{'success_icon', 'success_color', 'failure_icon', 'failure_color'} \
|
||||
'tide_status_'{'success_icon', 'success_color', 'failure_icon', 'failure_color'} \
|
||||
# ------------Cmd_Duration-----------
|
||||
'lean_cmd_duration_'{'color', 'decimals', 'threshold'} \
|
||||
'tide_cmd_duration_'{'color', 'decimals', 'threshold'} \
|
||||
# ----------------SSH----------------
|
||||
'lean_context_'{'ssh_color', 'root_color'} \
|
||||
'tide_context_'{'ssh_color', 'root_color'} \
|
||||
# ---------------Jobs---------------
|
||||
'lean_jobs_'{'icon', 'color'} \
|
||||
'tide_jobs_'{'icon', 'color'} \
|
||||
# ---------------Time---------------
|
||||
'lean_time_'{'format', 'color'}
|
||||
'tide_time_'{'format', 'color'}
|
||||
|
||||
for var in $rmVars
|
||||
set -e $var
|
||||
end
|
||||
|
||||
echo 'Lean theme uninstalled.'
|
||||
echo 'Tide theme uninstalled.'
|
||||
end
|
||||
|
||||
function _user_confirm_defaultNo -a question
|
Loading…
Reference in New Issue
Block a user