From 4ef1672e51668f024fb97da786d9fd2704387289 Mon Sep 17 00:00:00 2001 From: candifloss Date: Fri, 17 Jul 2026 10:33:51 +0530 Subject: [PATCH] More theme functions - `fish_list_themes` - `fish_theme` --- conf.d/25_prompt_theme.fish | 11 ++++++++++- functions/fish_list_themes.fish | 7 +++++++ functions/fish_theme.fish | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 functions/fish_list_themes.fish create mode 100644 functions/fish_theme.fish diff --git a/conf.d/25_prompt_theme.fish b/conf.d/25_prompt_theme.fish index 25dfcb8..b676799 100644 --- a/conf.d/25_prompt_theme.fish +++ b/conf.d/25_prompt_theme.fish @@ -1,6 +1,15 @@ # Prompt theme -# Set the theme name. Default: "default" +# To get a list of available themes: +# - Check the theme directories in $__fish_config_dir/themes/ +# - Or use the funtion `fish_list_themes` +# To print the active prompt theme name: +# Use function `fish_theme` + +# Set the theme name. +# Default: "default" +# The theme name must match the theme directory name. set -g FISH_PROMPT_THEME default +# Load theme fish_load_theme $FISH_PROMPT_THEME \ No newline at end of file diff --git a/functions/fish_list_themes.fish b/functions/fish_list_themes.fish new file mode 100644 index 0000000..190bcf6 --- /dev/null +++ b/functions/fish_list_themes.fish @@ -0,0 +1,7 @@ +function fish_list_themes --description "List available prompt themes" + for theme in $__fish_config_dir/themes/* + if test -d $theme + basename $theme + end + end +end \ No newline at end of file diff --git a/functions/fish_theme.fish b/functions/fish_theme.fish new file mode 100644 index 0000000..03b67f0 --- /dev/null +++ b/functions/fish_theme.fish @@ -0,0 +1,3 @@ +function fish_theme --description "Print the active prompt theme" + echo $FISH_PROMPT_THEME +end \ No newline at end of file