From 434bdce98738600ac53323414dd4adb4cdc7d4a2 Mon Sep 17 00:00:00 2001 From: Candifloss Date: Thu, 16 Jul 2026 07:27:21 +0530 Subject: [PATCH] Introduce themes --- conf.d/25_prompt_theme.fish | 12 ++++++++++++ conf.d/31_right_prompt.fish | 2 -- functions/fish_prompt.fish | 3 +++ functions/fish_right_prompt.fish | 5 +++++ conf.d/30_prompt.fish => themes/default/prompt.fish | 3 ++- 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 conf.d/25_prompt_theme.fish delete mode 100644 conf.d/31_right_prompt.fish create mode 100644 functions/fish_prompt.fish create mode 100644 functions/fish_right_prompt.fish rename conf.d/30_prompt.fish => themes/default/prompt.fish (94%) diff --git a/conf.d/25_prompt_theme.fish b/conf.d/25_prompt_theme.fish new file mode 100644 index 0000000..6c63cb2 --- /dev/null +++ b/conf.d/25_prompt_theme.fish @@ -0,0 +1,12 @@ +# Prompt theme + +# Change "default" to preferred theme name +set -g FISH_PROMPT_THEME default + +set -l theme_dir ~/.config/fish/themes/$FISH_PROMPT_THEME + +source $theme_dir/prompt.fish + +if test -f $theme_dir/right_prompt.fish + source $theme_dir/right_prompt.fish +end \ No newline at end of file diff --git a/conf.d/31_right_prompt.fish b/conf.d/31_right_prompt.fish deleted file mode 100644 index cac89a0..0000000 --- a/conf.d/31_right_prompt.fish +++ /dev/null @@ -1,2 +0,0 @@ -# Right-side prompt -# Empty for now \ No newline at end of file diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish new file mode 100644 index 0000000..9a4a957 --- /dev/null +++ b/functions/fish_prompt.fish @@ -0,0 +1,3 @@ +function fish_prompt + __fish_theme_prompt +end \ No newline at end of file diff --git a/functions/fish_right_prompt.fish b/functions/fish_right_prompt.fish new file mode 100644 index 0000000..5d388e3 --- /dev/null +++ b/functions/fish_right_prompt.fish @@ -0,0 +1,5 @@ +function fish_right_prompt + if functions -q __fish_theme_right_prompt + __fish_theme_right_prompt + end +end \ No newline at end of file diff --git a/conf.d/30_prompt.fish b/themes/default/prompt.fish similarity index 94% rename from conf.d/30_prompt.fish rename to themes/default/prompt.fish index 194f7a5..10be6c0 100644 --- a/conf.d/30_prompt.fish +++ b/themes/default/prompt.fish @@ -1,6 +1,7 @@ +# Default theme # Shell prompt: Left side -function fish_prompt +function __fish_theme_prompt set -l exit_status $status set -l prompt_symbol set -l user_color