@heyitsiveen/dotfiles 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +10 -7
- package/dotfiles/macos/.config/fish/completions/fisher.fish +7 -0
- package/dotfiles/macos/.config/fish/completions/tide.fish +13 -0
- package/dotfiles/macos/.config/fish/conf.d/_tide_init.fish +44 -0
- package/dotfiles/macos/.config/fish/fish_plugins +2 -0
- package/dotfiles/macos/.config/fish/functions/_tide_1_line_prompt.fish +19 -0
- package/dotfiles/macos/.config/fish/functions/_tide_2_line_prompt.fish +31 -0
- package/dotfiles/macos/.config/fish/functions/_tide_cache_variables.fish +17 -0
- package/dotfiles/macos/.config/fish/functions/_tide_detect_os.fish +76 -0
- package/dotfiles/macos/.config/fish/functions/_tide_find_and_remove.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_fish_colorize.fish +7 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_aws.fish +11 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_bun.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_character.fish +17 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_cmd_duration.fish +12 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_context.fish +14 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_crystal.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_direnv.fish +7 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_distrobox.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_docker.fish +5 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_elixir.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_gcloud.fish +8 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_git.fish +72 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_go.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_java.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_jobs.fish +7 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_kubectl.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_nix_shell.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_node.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_os.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_php.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_private_mode.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_pulumi.fish +19 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_python.fish +27 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_ruby.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_rustc.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_shlvl.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_status.fish +15 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_terraform.fish +5 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_time.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_toolbox.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_vi_mode.fish +16 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_zig.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_parent_dirs.fish +10 -0
- package/dotfiles/macos/.config/fish/functions/_tide_print_item.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/_tide_pwd.fish +42 -0
- package/dotfiles/macos/.config/fish/functions/_tide_remove_unusable_items.fish +25 -0
- package/dotfiles/macos/.config/fish/functions/_tide_sub_bug-report.fish +73 -0
- package/dotfiles/macos/.config/fish/functions/_tide_sub_configure.fish +156 -0
- package/dotfiles/macos/.config/fish/functions/_tide_sub_reload.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/fish_greeting.fish +1 -4
- package/dotfiles/macos/.config/fish/functions/fish_mode_prompt.fish +1 -0
- package/dotfiles/macos/.config/fish/functions/fish_prompt.fish +170 -0
- package/dotfiles/macos/.config/fish/functions/fisher.fish +251 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/finish.fish +46 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/icons.fish +33 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_colors.fish +26 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_connection.fish +31 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_spacing.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/show_time.fish +33 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/style.fish +36 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/transient.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish +38 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish +26 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish +32 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_style.fish +51 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_right_prompt_frame.fish +20 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/classic.fish +118 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/classic_16color.fish +91 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/lean.fish +118 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/lean_16color.fish +91 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/rainbow.fish +118 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/rainbow_16color.fish +95 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_cache_variables.fish +41 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_character.fish +8 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish +5 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish +42 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_pwd.fish +11 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/icons.fish +41 -0
- package/dotfiles/macos/.config/fish/functions/tide.fish +28 -0
- package/dotfiles/windows/powershell/Profile.ps1 +0 -4
- package/dotfiles/windows/powershell/functions/Switch-PromptPalette.ps1 +1 -1
- package/dotfiles/windows/powershell/modules/prompt.ps1 +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -200,11 +200,14 @@ async function uninstallGroups(groups) {
|
|
|
200
200
|
const errors = [];
|
|
201
201
|
for (const group of groups) {
|
|
202
202
|
const termDefault = TERMINAL_DEFAULTS[group.name];
|
|
203
|
-
|
|
204
|
-
if (
|
|
205
|
-
|
|
203
|
+
try {
|
|
204
|
+
if (termDefault) {
|
|
205
|
+
const configPath = group.files.find((f) => f.endsWith(termDefault.file));
|
|
206
|
+
if (configPath && await pathExists$2(configPath)) await writeFile(configPath, termDefault.content, "utf-8");
|
|
207
|
+
for (const file of group.files) if (file !== configPath && await pathExists$2(file)) await remove(file);
|
|
208
|
+
} else if (await pathExists$2(group.target)) await remove(group.target);
|
|
206
209
|
} catch (err) {
|
|
207
|
-
errors.push(`${
|
|
210
|
+
errors.push(`${group.name}: ${err instanceof Error ? err.message : String(err)}`);
|
|
208
211
|
}
|
|
209
212
|
}
|
|
210
213
|
return errors;
|
|
@@ -255,7 +258,7 @@ function getDependencyTools(platform) {
|
|
|
255
258
|
{
|
|
256
259
|
name: "fastfetch",
|
|
257
260
|
binary: "fastfetch",
|
|
258
|
-
description: "System info
|
|
261
|
+
description: "System info tool",
|
|
259
262
|
installCmd: "brew install fastfetch",
|
|
260
263
|
required: false
|
|
261
264
|
},
|
|
@@ -293,7 +296,7 @@ function getDependencyTools(platform) {
|
|
|
293
296
|
{
|
|
294
297
|
name: "fastfetch",
|
|
295
298
|
binary: "fastfetch",
|
|
296
|
-
description: "System info
|
|
299
|
+
description: "System info tool",
|
|
297
300
|
installCmd: "winget install Fastfetch-cli.Fastfetch",
|
|
298
301
|
required: false
|
|
299
302
|
},
|
|
@@ -647,7 +650,7 @@ async function switchTideTheme(targetDir, theme) {
|
|
|
647
650
|
await writeFile(filePath, (await readFile(filePath, "utf-8")).replace(/^(set -l tide_default_palette )\S+$/m, `$1${tidePalettes[theme]}`), "utf-8");
|
|
648
651
|
}
|
|
649
652
|
async function switchOmpTheme(theme) {
|
|
650
|
-
const themeDir = join(homedir(),
|
|
653
|
+
const themeDir = join(homedir(), MANIFEST_DIR, "oh-my-posh");
|
|
651
654
|
await ensureDir(themeDir);
|
|
652
655
|
await writeFile(join(themeDir, "prompt-theme.txt"), theme, "utf-8");
|
|
653
656
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
complete --command fisher --exclusive --long help --description "Print help"
|
|
2
|
+
complete --command fisher --exclusive --long version --description "Print version"
|
|
3
|
+
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins"
|
|
4
|
+
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins"
|
|
5
|
+
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins"
|
|
6
|
+
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex"
|
|
7
|
+
complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
complete tide --no-files
|
|
2
|
+
|
|
3
|
+
set -l subcommands bug-report configure reload
|
|
4
|
+
|
|
5
|
+
complete tide -x -n __fish_use_subcommand -a bug-report -d "Print info for use in bug reports"
|
|
6
|
+
complete tide -x -n __fish_use_subcommand -a configure -d "Run the configuration wizard"
|
|
7
|
+
complete tide -x -n __fish_use_subcommand -a reload -d "Reload tide configuration"
|
|
8
|
+
|
|
9
|
+
complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s h -l help -d "Print help message"
|
|
10
|
+
complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s v -l version -d "Print tide version"
|
|
11
|
+
|
|
12
|
+
complete tide -x -n '__fish_seen_subcommand_from bug-report' -l clean -d "Run clean Fish instance and install Tide"
|
|
13
|
+
complete tide -x -n '__fish_seen_subcommand_from bug-report' -l verbose -d "Print full Tide configuration"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function _tide_init_install --on-event _tide_init_install
|
|
2
|
+
set -U VIRTUAL_ENV_DISABLE_PROMPT true
|
|
3
|
+
|
|
4
|
+
source (functions --details _tide_sub_configure)
|
|
5
|
+
_load_config lean
|
|
6
|
+
_tide_finish
|
|
7
|
+
|
|
8
|
+
if status is-interactive
|
|
9
|
+
tide bug-report --check || sleep 4
|
|
10
|
+
|
|
11
|
+
if contains ilancosman/tide (string lower $_fisher_plugins)
|
|
12
|
+
set_color bryellow
|
|
13
|
+
echo "ilancosman/tide is a development branch. Please install from a release tag:"
|
|
14
|
+
_tide_fish_colorize "fisher install ilancosman/tide@v6"
|
|
15
|
+
sleep 3
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
switch (read --prompt-str="Configure tide prompt? [Y/n] " | string lower)
|
|
19
|
+
case y ye yes ''
|
|
20
|
+
tide configure
|
|
21
|
+
case '*'
|
|
22
|
+
echo -s \n 'Run ' (_tide_fish_colorize "tide configure") ' to customize your prompt.'
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
function _tide_init_update --on-event _tide_init_update
|
|
28
|
+
# Warn users who install from main branch
|
|
29
|
+
if contains ilancosman/tide (string lower $_fisher_plugins)
|
|
30
|
+
set_color bryellow
|
|
31
|
+
echo "ilancosman/tide is a development branch. Please install from a release tag:"
|
|
32
|
+
_tide_fish_colorize "fisher install ilancosman/tide@v6"
|
|
33
|
+
sleep 3
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Set (disable) the new jobs variable
|
|
37
|
+
set -q tide_jobs_number_threshold || set -U tide_jobs_number_threshold 1000
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
function _tide_init_uninstall --on-event _tide_init_uninstall
|
|
41
|
+
set -e VIRTUAL_ENV_DISABLE_PROMPT
|
|
42
|
+
set -e (set -U --names | string match --entire -r '^_?tide')
|
|
43
|
+
functions --erase (functions --all | string match --entire -r '^_?tide')
|
|
44
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _tide_1_line_prompt
|
|
2
|
+
set -g add_prefix
|
|
3
|
+
_tide_side=left for item in $_tide_left_items
|
|
4
|
+
_tide_item_$item
|
|
5
|
+
end
|
|
6
|
+
set_color $prev_bg_color -b normal
|
|
7
|
+
echo $tide_left_prompt_suffix
|
|
8
|
+
|
|
9
|
+
set -g add_prefix
|
|
10
|
+
_tide_side=right for item in $_tide_right_items
|
|
11
|
+
_tide_item_$item
|
|
12
|
+
end
|
|
13
|
+
set_color $prev_bg_color -b normal
|
|
14
|
+
echo $tide_right_prompt_suffix
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
function _tide_item_pwd
|
|
18
|
+
_tide_print_item pwd @PWD@
|
|
19
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function _tide_2_line_prompt
|
|
2
|
+
set -g add_prefix
|
|
3
|
+
_tide_side=left for item in $_tide_left_items
|
|
4
|
+
_tide_item_$item
|
|
5
|
+
end
|
|
6
|
+
if not set -e add_prefix
|
|
7
|
+
set_color $prev_bg_color -b normal
|
|
8
|
+
echo $tide_left_prompt_suffix
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
echo
|
|
12
|
+
|
|
13
|
+
set -g add_prefix
|
|
14
|
+
_tide_side=right for item in $_tide_right_items
|
|
15
|
+
_tide_item_$item
|
|
16
|
+
end
|
|
17
|
+
if not set -e add_prefix
|
|
18
|
+
set_color $prev_bg_color -b normal
|
|
19
|
+
echo $tide_right_prompt_suffix
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
function _tide_item_pwd
|
|
24
|
+
_tide_print_item pwd @PWD@
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
function _tide_item_newline
|
|
28
|
+
set_color $prev_bg_color -b normal
|
|
29
|
+
v=tide_"$_tide_side"_prompt_suffix echo $$v
|
|
30
|
+
set -g add_prefix
|
|
31
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function _tide_cache_variables
|
|
2
|
+
# Same-color-separator color
|
|
3
|
+
set_color $tide_prompt_color_separator_same_color | read -gx _tide_color_separator_same_color
|
|
4
|
+
|
|
5
|
+
# git
|
|
6
|
+
contains git $_tide_left_items $_tide_right_items && set_color $tide_git_color_branch | read -gx _tide_location_color
|
|
7
|
+
|
|
8
|
+
# private_mode
|
|
9
|
+
if contains private_mode $_tide_left_items $_tide_right_items && test -n "$fish_private_mode"
|
|
10
|
+
set -gx _tide_private_mode
|
|
11
|
+
else
|
|
12
|
+
set -e _tide_private_mode
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# item padding
|
|
16
|
+
test "$tide_prompt_pad_items" = true && set -gx _tide_pad ' ' || set -e _tide_pad
|
|
17
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Outputs icon, color, bg_color
|
|
2
|
+
function _tide_detect_os
|
|
3
|
+
set -lx defaultColor 080808 CED7CF
|
|
4
|
+
switch (uname | string lower)
|
|
5
|
+
case darwin
|
|
6
|
+
printf %s\n D6D6D6 333333 # from apple.com header
|
|
7
|
+
case freebsd openbsd dragonfly
|
|
8
|
+
printf %s\n FFFFFF AB2B28 # https://freebsdfoundation.org/about-us/about-the-foundation/project/
|
|
9
|
+
case 'cygwin*' 'mingw*_nt*' 'msys_nt*'
|
|
10
|
+
printf %s\n FFFFFF 00CCFF # https://answers.microsoft.com/en-us/windows/forum/all/what-is-the-official-windows-8-blue-rgb-or-hex/fd57144b-f69b-42d8-8c21-6ca911646e44
|
|
11
|
+
case linux
|
|
12
|
+
if test (uname -o) = Android
|
|
13
|
+
# https://developer.android.com/distribute/marketing-tools/brand-guidelines
|
|
14
|
+
printf %s\n 3DDC84 3C3F41 # fg is from above link, bg is from Android Studio default dark theme
|
|
15
|
+
else
|
|
16
|
+
_tide_detect_os_linux_cases /etc/os-release ID ||
|
|
17
|
+
_tide_detect_os_linux_cases /etc/os-release ID_LIKE ||
|
|
18
|
+
_tide_detect_os_linux_cases /etc/lsb-release DISTRIB_ID ||
|
|
19
|
+
printf %s\n $defaultColor
|
|
20
|
+
end
|
|
21
|
+
case '*'
|
|
22
|
+
echo -ns '?'
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
function _tide_detect_os_linux_cases -a file key
|
|
27
|
+
test -e $file || return
|
|
28
|
+
set -l split_file (string split '=' <$file)
|
|
29
|
+
set -l key_index (contains --index $key $split_file) || return
|
|
30
|
+
set -l value (string trim --chars='"' $split_file[(math $key_index + 1)])
|
|
31
|
+
|
|
32
|
+
# Anything which would have pure white background has been changed to D4D4D4
|
|
33
|
+
# It was just too bright otherwise
|
|
34
|
+
switch (string lower $value)
|
|
35
|
+
case alpine
|
|
36
|
+
printf %s\n FFFFFF 0D597F # from alpine logo
|
|
37
|
+
case arch
|
|
38
|
+
printf %s\n 1793D1 4D4D4D # from arch wiki header
|
|
39
|
+
case centos
|
|
40
|
+
printf %s\n 000000 D4D4D4 # https://wiki.centos.org/ArtWork/Brand/Logo, monochromatic
|
|
41
|
+
case debian
|
|
42
|
+
printf %s\n C70036 D4D4D4 # from debian logo https://www.debian.org/logos/openlogo-nd-100.png
|
|
43
|
+
case devuan
|
|
44
|
+
printf %s\n $defaultColor # logo is monochromatic
|
|
45
|
+
case elementary
|
|
46
|
+
printf %s\n 000000 D4D4D4 # https://elementary.io/brand, encouraged to be monochromatic
|
|
47
|
+
case fedora
|
|
48
|
+
printf %s\n FFFFFF 294172 # from logo https://fedoraproject.org/w/uploads/2/2d/Logo_fedoralogo.png
|
|
49
|
+
case gentoo
|
|
50
|
+
printf %s\n FFFFFF 54487A # https://wiki.gentoo.org/wiki/Project:Artwork/Colors
|
|
51
|
+
case mageia
|
|
52
|
+
printf %s\n FFFFFF 262F45 # https://wiki.mageia.org/en/Artwork_guidelines
|
|
53
|
+
case manjaro
|
|
54
|
+
printf %s\n FFFFFF 35BF5C # from https://gitlab.manjaro.org/artwork/branding/logo/-/blob/master/logo.svg
|
|
55
|
+
case mint linuxmint
|
|
56
|
+
printf %s\n FFFFFF 69B53F # extracted from https://linuxmint.com/web/img/favicon.ico
|
|
57
|
+
case nixos
|
|
58
|
+
printf %s\n FFFFFF 5277C3 # https://github.com/NixOS/nixos-artwork/tree/master/logo
|
|
59
|
+
case opensuse-leap opensuse-tumbleweed opensuse-microos
|
|
60
|
+
printf %s\n 73BA25 173f4f # https://en.opensuse.org/openSUSE:Artwork_brand
|
|
61
|
+
case raspbian
|
|
62
|
+
printf %s\n FFFFFF A22846 # https://static.raspberrypi.org/files/Raspberry_Pi_Visual_Guidelines_2020.pdf
|
|
63
|
+
case rhel
|
|
64
|
+
printf %s\n EE0000 000000 # https://www.redhat.com/en/about/brand/standards/color
|
|
65
|
+
case sabayon
|
|
66
|
+
printf %s\n $defaultColor # Can't find colors, and they are rebranding anyway
|
|
67
|
+
case slackware
|
|
68
|
+
printf %s\n $defaultColor # Doesn't really have a logo, and the colors are too close to PWD blue anyway
|
|
69
|
+
case ubuntu
|
|
70
|
+
printf %s\n E95420 D4D4D4 # https://design.ubuntu.com/brand/
|
|
71
|
+
case void
|
|
72
|
+
printf %s\n FFFFFF 478061 # from https://alpha.de.repo.voidlinux.org/logos/void.svg
|
|
73
|
+
case '*'
|
|
74
|
+
return 1
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function _tide_item_aws
|
|
2
|
+
# AWS_PROFILE overrides AWS_DEFAULT_PROFILE, AWS_REGION overrides AWS_DEFAULT_REGION
|
|
3
|
+
set -q AWS_PROFILE && set -l AWS_DEFAULT_PROFILE $AWS_PROFILE
|
|
4
|
+
set -q AWS_REGION && set -l AWS_DEFAULT_REGION $AWS_REGION
|
|
5
|
+
|
|
6
|
+
if test -n "$AWS_DEFAULT_PROFILE" && test -n "$AWS_DEFAULT_REGION"
|
|
7
|
+
_tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE/$AWS_DEFAULT_REGION"
|
|
8
|
+
else if test -n "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION"
|
|
9
|
+
_tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function _tide_item_character
|
|
2
|
+
test $_tide_status = 0 && set_color $tide_character_color || set_color $tide_character_color_failure
|
|
3
|
+
|
|
4
|
+
set -q add_prefix || echo -ns ' '
|
|
5
|
+
|
|
6
|
+
test "$fish_key_bindings" = fish_default_key_bindings && echo -ns $tide_character_icon ||
|
|
7
|
+
switch $fish_bind_mode
|
|
8
|
+
case insert
|
|
9
|
+
echo -ns $tide_character_icon
|
|
10
|
+
case default
|
|
11
|
+
echo -ns $tide_character_vi_icon_default
|
|
12
|
+
case replace replace_one
|
|
13
|
+
echo -ns $tide_character_vi_icon_replace
|
|
14
|
+
case visual
|
|
15
|
+
echo -ns $tide_character_vi_icon_visual
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function _tide_item_cmd_duration
|
|
2
|
+
test $CMD_DURATION -gt $tide_cmd_duration_threshold && t=(
|
|
3
|
+
math -s0 "$CMD_DURATION/3600000" # Hours
|
|
4
|
+
math -s0 "$CMD_DURATION/60000"%60 # Minutes
|
|
5
|
+
math -s$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) if test $t[1] != 0
|
|
6
|
+
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[1]h $t[2]m $t[3]s"
|
|
7
|
+
else if test $t[2] != 0
|
|
8
|
+
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[2]m $t[3]s"
|
|
9
|
+
else
|
|
10
|
+
_tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[3]s"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function _tide_item_context
|
|
2
|
+
if set -q SSH_TTY
|
|
3
|
+
set -fx tide_context_color $tide_context_color_ssh
|
|
4
|
+
else if test "$EUID" = 0
|
|
5
|
+
set -fx tide_context_color $tide_context_color_root
|
|
6
|
+
else if test "$tide_context_always_display" = true
|
|
7
|
+
set -fx tide_context_color $tide_context_color_default
|
|
8
|
+
else
|
|
9
|
+
return
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
string match -qr "^(?<h>(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname
|
|
13
|
+
_tide_print_item context $USER$h
|
|
14
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function _tide_item_direnv
|
|
2
|
+
set -q DIRENV_DIR || return
|
|
3
|
+
direnv status | string match -q 'Found RC allowed false' &&
|
|
4
|
+
set -lx tide_direnv_color $tide_direnv_color_denied &&
|
|
5
|
+
set -lx tide_direnv_bg_color $tide_direnv_bg_color_denied
|
|
6
|
+
_tide_print_item direnv $tide_direnv_icon
|
|
7
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function _tide_item_gcloud
|
|
2
|
+
set -q CLOUDSDK_CONFIG || set -l CLOUDSDK_CONFIG ~/.config/gcloud
|
|
3
|
+
path is $CLOUDSDK_CONFIG/active_config &&
|
|
4
|
+
read -l config <$CLOUDSDK_CONFIG/active_config &&
|
|
5
|
+
path is $CLOUDSDK_CONFIG/configurations/config_$config &&
|
|
6
|
+
string match -qr '^\s*project\s*=\s*(?<project>.*)' <$CLOUDSDK_CONFIG/configurations/config_$config &&
|
|
7
|
+
_tide_print_item gcloud $tide_gcloud_icon' ' $project
|
|
8
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function _tide_item_git
|
|
2
|
+
if git branch --show-current 2>/dev/null | string shorten -"$tide_git_truncation_strategy"m$tide_git_truncation_length | read -l location
|
|
3
|
+
git rev-parse --git-dir --is-inside-git-dir | read -fL gdir in_gdir
|
|
4
|
+
set location $_tide_location_color$location
|
|
5
|
+
else if test $pipestatus[1] != 0
|
|
6
|
+
return
|
|
7
|
+
else if git tag --points-at HEAD | string shorten -"$tide_git_truncation_strategy"m$tide_git_truncation_length | read location
|
|
8
|
+
git rev-parse --git-dir --is-inside-git-dir | read -fL gdir in_gdir
|
|
9
|
+
set location '#'$_tide_location_color$location
|
|
10
|
+
else
|
|
11
|
+
git rev-parse --git-dir --is-inside-git-dir --short HEAD | read -fL gdir in_gdir location
|
|
12
|
+
set location @$_tide_location_color$location
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Operation
|
|
16
|
+
if test -d $gdir/rebase-merge
|
|
17
|
+
# Turn ANY into ALL, via double negation
|
|
18
|
+
if not path is -v $gdir/rebase-merge/{msgnum,end}
|
|
19
|
+
read -f step <$gdir/rebase-merge/msgnum
|
|
20
|
+
read -f total_steps <$gdir/rebase-merge/end
|
|
21
|
+
end
|
|
22
|
+
test -f $gdir/rebase-merge/interactive && set -f operation rebase-i || set -f operation rebase-m
|
|
23
|
+
else if test -d $gdir/rebase-apply
|
|
24
|
+
if not path is -v $gdir/rebase-apply/{next,last}
|
|
25
|
+
read -f step <$gdir/rebase-apply/next
|
|
26
|
+
read -f total_steps <$gdir/rebase-apply/last
|
|
27
|
+
end
|
|
28
|
+
if test -f $gdir/rebase-apply/rebasing
|
|
29
|
+
set -f operation rebase
|
|
30
|
+
else if test -f $gdir/rebase-apply/applying
|
|
31
|
+
set -f operation am
|
|
32
|
+
else
|
|
33
|
+
set -f operation am/rebase
|
|
34
|
+
end
|
|
35
|
+
else if test -f $gdir/MERGE_HEAD
|
|
36
|
+
set -f operation merge
|
|
37
|
+
else if test -f $gdir/CHERRY_PICK_HEAD
|
|
38
|
+
set -f operation cherry-pick
|
|
39
|
+
else if test -f $gdir/REVERT_HEAD
|
|
40
|
+
set -f operation revert
|
|
41
|
+
else if test -f $gdir/BISECT_LOG
|
|
42
|
+
set -f operation bisect
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Git status/stash + Upstream behind/ahead
|
|
46
|
+
test $in_gdir = true && set -l _set_dir_opt -C $gdir/..
|
|
47
|
+
# Suppress errors in case we are in a bare repo or there is no upstream
|
|
48
|
+
set -l stat (git $_set_dir_opt --no-optional-locks status --porcelain 2>/dev/null)
|
|
49
|
+
string match -qr '(0|(?<stash>.*))\n(0|(?<conflicted>.*))\n(0|(?<staged>.*))
|
|
50
|
+
(0|(?<dirty>.*))\n(0|(?<untracked>.*))(\n(0|(?<behind>.*))\t(0|(?<ahead>.*)))?' \
|
|
51
|
+
"$(git $_set_dir_opt stash list 2>/dev/null | count
|
|
52
|
+
string match -r ^UU $stat | count
|
|
53
|
+
string match -r ^[ADMR] $stat | count
|
|
54
|
+
string match -r ^.[ADMR] $stat | count
|
|
55
|
+
string match -r '^\?\?' $stat | count
|
|
56
|
+
git rev-list --count --left-right @{upstream}...HEAD 2>/dev/null)"
|
|
57
|
+
|
|
58
|
+
if test -n "$operation$conflicted"
|
|
59
|
+
set -g tide_git_bg_color $tide_git_bg_color_urgent
|
|
60
|
+
else if test -n "$staged$dirty$untracked"
|
|
61
|
+
set -g tide_git_bg_color $tide_git_bg_color_unstable
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
_tide_print_item git $_tide_location_color$tide_git_icon' ' (set_color white; echo -ns $location
|
|
65
|
+
set_color $tide_git_color_operation; echo -ns ' '$operation ' '$step/$total_steps
|
|
66
|
+
set_color $tide_git_color_upstream; echo -ns ' ⇣'$behind ' ⇡'$ahead
|
|
67
|
+
set_color $tide_git_color_stash; echo -ns ' *'$stash
|
|
68
|
+
set_color $tide_git_color_conflicted; echo -ns ' ~'$conflicted
|
|
69
|
+
set_color $tide_git_color_staged; echo -ns ' +'$staged
|
|
70
|
+
set_color $tide_git_color_dirty; echo -ns ' !'$dirty
|
|
71
|
+
set_color $tide_git_color_untracked; echo -ns ' ?'$untracked)
|
|
72
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _tide_item_pulumi
|
|
2
|
+
if path filter $_tide_parent_dirs/Pulumi.yaml | read -l yaml_path
|
|
3
|
+
if command -q sha1sum
|
|
4
|
+
echo -n "$yaml_path" | sha1sum | string match -qr "(?<path_hash>.{40})"
|
|
5
|
+
else if command -q shasum
|
|
6
|
+
echo -n "$yaml_path" | shasum | string match -qr "(?<path_hash>.{40})"
|
|
7
|
+
else
|
|
8
|
+
return
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
string match -qr 'name: *(?<project_name>.*)' <$yaml_path
|
|
12
|
+
set -l workspace_file "$HOME/.pulumi/workspaces/$project_name-$path_hash-workspace.json"
|
|
13
|
+
|
|
14
|
+
if test -e $workspace_file
|
|
15
|
+
string match -qr '"stack": *"(?<stack>.*)"' <$workspace_file
|
|
16
|
+
_tide_print_item pulumi $tide_pulumi_icon' ' $stack
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function _tide_item_python
|
|
2
|
+
if test -n "$VIRTUAL_ENV"
|
|
3
|
+
if command -q python3
|
|
4
|
+
python3 --version | string match -qr "(?<v>[\d.]+)"
|
|
5
|
+
else
|
|
6
|
+
python --version | string match -qr "(?<v>[\d.]+)"
|
|
7
|
+
end
|
|
8
|
+
string match -qr "^.*/(?<dir>.*)/(?<base>.*)" $VIRTUAL_ENV
|
|
9
|
+
# pipenv $VIRTUAL_ENV looks like /home/ilan/.local/share/virtualenvs/pipenv_project-EwRYuc3l
|
|
10
|
+
# Detect whether we are using pipenv by looking for 'virtualenvs'. If so, remove the hash at the end.
|
|
11
|
+
if test "$dir" = virtualenvs
|
|
12
|
+
string match -qr "(?<base>.*)-.*" $base
|
|
13
|
+
_tide_print_item python $tide_python_icon' ' "$v ($base)"
|
|
14
|
+
else if contains -- "$base" virtualenv venv .venv env # avoid generic names
|
|
15
|
+
_tide_print_item python $tide_python_icon' ' "$v ($dir)"
|
|
16
|
+
else
|
|
17
|
+
_tide_print_item python $tide_python_icon' ' "$v ($base)"
|
|
18
|
+
end
|
|
19
|
+
else if path is .python-version Pipfile __init__.py pyproject.toml requirements.txt setup.py
|
|
20
|
+
if command -q python3
|
|
21
|
+
python3 --version | string match -qr "(?<v>[\d.]+)"
|
|
22
|
+
else
|
|
23
|
+
python --version | string match -qr "(?<v>[\d.]+)"
|
|
24
|
+
end
|
|
25
|
+
_tide_print_item python $tide_python_icon' ' $v
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function _tide_item_status
|
|
2
|
+
if string match -qv 0 $_tide_pipestatus # If there is a failure anywhere in the pipestatus
|
|
3
|
+
if test "$_tide_pipestatus" = 1 # If simple failure
|
|
4
|
+
contains character $_tide_left_items || tide_status_bg_color=$tide_status_bg_color_failure \
|
|
5
|
+
tide_status_color=$tide_status_color_failure _tide_print_item status $tide_status_icon_failure' ' 1
|
|
6
|
+
else
|
|
7
|
+
fish_status_to_signal $_tide_pipestatus | string replace SIG '' | string join '|' | read -l out
|
|
8
|
+
test $_tide_status = 0 && _tide_print_item status $tide_status_icon' ' $out ||
|
|
9
|
+
tide_status_bg_color=$tide_status_bg_color_failure tide_status_color=$tide_status_color_failure \
|
|
10
|
+
_tide_print_item status $tide_status_icon_failure' ' $out
|
|
11
|
+
end
|
|
12
|
+
else if not contains character $_tide_left_items
|
|
13
|
+
_tide_print_item status $tide_status_icon
|
|
14
|
+
end
|
|
15
|
+
end
|