diff --git a/jmb.omp.toml b/jmb.omp.toml index db9ad4a..5198a8e 100644 --- a/jmb.omp.toml +++ b/jmb.omp.toml @@ -56,8 +56,15 @@ console_title_template = '{{ .Folder }}' always_enabled = true [[blocks]] - type = 'prompt' - alignment = 'right' + type = 'rprompt' + alignment = 'left' + + [[blocks.segments]] + type = "text" + style = "plain" + foreground = "black" + background = "transparent" + template = "{{ if .Env.SHELL_LOADING }} loading {{ end }}" [[blocks.segments]] type = "executiontime" diff --git a/sheldon.toml b/sheldon.toml index 27c89df..9f1fc82 100644 --- a/sheldon.toml +++ b/sheldon.toml @@ -10,6 +10,11 @@ shell = "zsh" defer = """{{ hooks?.pre | nl }}{% for file in files %}zsh-defer source "{{ file }}"\n{% endfor %}{{ hooks?.post | nl }}""" defer-more = """{{ hooks?.pre | nl }}{% for file in files %}zsh-defer -t 0.5 source "{{ file }}"\n{% endfor %}{{ hooks?.post | nl }}""" +# Loading indicator +# ----------------- + +[plugins.show] +local = "~/.zsh/plugins/loading" # Completions # ----------- @@ -96,3 +101,10 @@ apply = ["defer-more"] [plugins.ngrok] local = "~/.zsh/plugins" apply = ["defer-more"] + +# Loading indicator +# ----------------- + +[plugins.hide] +local = "~/.zsh/plugins/loading" +apply = ["defer-more"] diff --git a/zsh/plugins/loading/hide.plugin.zsh b/zsh/plugins/loading/hide.plugin.zsh new file mode 100644 index 0000000..e2e5ec2 --- /dev/null +++ b/zsh/plugins/loading/hide.plugin.zsh @@ -0,0 +1,4 @@ +#!/usr/bin/env zsh + +# Hide the loading indicator +unset SHELL_LOADING diff --git a/zsh/plugins/loading/show.plugin.zsh b/zsh/plugins/loading/show.plugin.zsh new file mode 100644 index 0000000..f6fe082 --- /dev/null +++ b/zsh/plugins/loading/show.plugin.zsh @@ -0,0 +1,4 @@ +#!/usr/bin/env zsh + +# Show the loading indicator +export SHELL_LOADING=true