dotfiles_fish_server/functions/fish_load_theme.fish
candifloss fd4bb034d8 Function: fish_load_theme
- Better way to load themes
- Load themes in a running session
2026-07-17 09:57:17 +05:30

25 lines
646 B
Fish

function fish_load_theme --description "Load a Fish prompt theme"
if test (count $argv) -ne 1
echo "Usage: fish_load_theme <theme>" >&2
return 1
end
set -l theme $argv[1]
set -l theme_dir $__fish_config_dir/themes/$theme
if not test -d $theme_dir
echo "fish_load_theme: Theme '$theme' not found." >&2
return 1
end
if not test -f $theme_dir/prompt.fish
echo "fish_load_theme: Theme '$theme' has no prompt.fish." >&2
return 1
end
source $theme_dir/prompt.fish
if test -f $theme_dir/right_prompt.fish
source $theme_dir/right_prompt.fish
end
end