Script
Specify the same script cross shell.
Executionโ
Scripts are not evaluated at shell startup, they are rendered once, when you run aliae init <shell> (which is what your shell profile calls on every new session). At that point, aliae
builds the whole init script in a fixed order โ env, then path, then alias, then link, then
script โ and templating ({{ }}, if) is resolved during this generation step, not when the
resulting shell script actually runs. This means a script's value and if cannot depend on
things set by an alias or another script at runtime; they only see the template context (.Shell,
.OS, ...) available at generation time.
Syntaxโ
script:
- value: |
oh-my-posh init nu
source ~/.oh-my-posh.nu
if: match .Shell "nu"
- value: |
load(io.popen('oh-my-posh init cmd'):read("*a"))()
if: match .Shell "cmd"
- value: |
oh-my-posh init pwsh | Invoke-Expression
if: match .Shell "pwsh"
- value: |
[[ -f "$HOME/.fig/shell/{{ .Shell }}rc.pre.{{ .Shell }}" ]] && builtin source "$HOME/.fig/shell/{{ .Shell }}rc.pre.{{ .Shell }}"
eval "$(oh-my-posh init {{ .Shell }})"
[ -f ~/.fzf.{{ .Shell }} ] && source ~/.fzf.{{ .Shell }}
[[ -f "$HOME/.fig/shell/{{ .Shell }}rc.post.{{ .Shell }}" ]] && builtin source "$HOME/.fig/shell/{{ .Shell }}rc.post.{{ .Shell }}"
if: match .Shell "bash" "zsh"
Pathโ
| Name | Type | Description |
|---|---|---|
value | string | the script you want to load. Supports templating |
if | string | golang template conditional statement, see if |