feat: add Starship prompt template

Add built-in Starship template that dynamically updates the prompt
color palette when switching Noctalia color schemes. Includes both
wallpaper-based and predefined template variants.
This commit is contained in:
Adria Martin
2026-04-08 12:43:27 +07:00
parent 48fe0f91a5
commit 5cf22040b3
4 changed files with 139 additions and 1 deletions
@@ -0,0 +1,41 @@
# Noctalia Starship Palette (predefined colorscheme)
# Generated by Noctalia - do not edit manually
[palettes.noctalia]
# Standard colors
blue = "{{colors.terminal_normal_blue.default.hex}}"
red = "{{colors.terminal_normal_red.default.hex}}"
green = "{{colors.terminal_normal_green.default.hex}}"
yellow = "{{colors.terminal_normal_yellow.default.hex}}"
cyan = "{{colors.terminal_normal_cyan.default.hex}}"
magenta = "{{colors.terminal_normal_magenta.default.hex}}"
white = "{{colors.terminal_normal_white.default.hex}}"
black = "{{colors.terminal_normal_black.default.hex}}"
# Extended palette (Catppuccin-compatible names)
rosewater = "{{colors.terminal_bright_yellow.default.hex}}"
flamingo = "{{colors.terminal_bright_red.default.hex}}"
pink = "{{colors.terminal_bright_magenta.default.hex}}"
mauve = "{{colors.terminal_normal_magenta.default.hex}}"
maroon = "{{colors.terminal_bright_red.default.hex}}"
peach = "{{colors.terminal_bright_yellow.default.hex}}"
teal = "{{colors.terminal_normal_cyan.default.hex}}"
sky = "{{colors.terminal_bright_cyan.default.hex}}"
sapphire = "{{colors.terminal_bright_blue.default.hex}}"
lavender = "{{colors.terminal_bright_magenta.default.hex}}"
# Text shades
text = "{{colors.terminal_foreground.default.hex}}"
subtext1 = "{{colors.terminal_normal_white.default.hex}}"
subtext0 = "{{colors.terminal_bright_black.default.hex}}"
# Surface shades
overlay2 = "{{colors.terminal_bright_black.default.hex}}"
overlay1 = "{{colors.terminal_bright_black.default.hex}}"
overlay0 = "{{colors.terminal_normal_black.default.hex}}"
surface2 = "{{colors.terminal_normal_black.default.hex}}"
surface1 = "{{colors.terminal_normal_black.default.hex}}"
surface0 = "{{colors.terminal_background.default.hex}}"
base = "{{colors.terminal_background.default.hex}}"
mantle = "{{colors.terminal_background.default.hex}}"
crust = "{{colors.terminal_background.default.hex}}"
+41
View File
@@ -0,0 +1,41 @@
# Noctalia Starship Palette (wallpaper-based)
# Generated by Noctalia - do not edit manually
[palettes.noctalia]
# Standard colors
blue = "{{colors.primary.default.hex}}"
red = "{{colors.error.default.hex}}"
green = "{{colors.secondary.default.hex}}"
yellow = "{{colors.tertiary.default.hex}}"
cyan = "{{colors.secondary_fixed_dim.default.hex}}"
magenta = "{{colors.primary_fixed_dim.default.hex}}"
white = "{{colors.on_surface.default.hex}}"
black = "{{colors.surface.default.hex}}"
# Extended palette (Catppuccin-compatible names)
rosewater = "{{colors.tertiary.default.hex}}"
flamingo = "{{colors.tertiary_fixed_dim.default.hex}}"
pink = "{{colors.primary_fixed_dim.default.hex}}"
mauve = "{{colors.inverse_primary.default.hex}}"
maroon = "{{colors.error.default.hex}}"
peach = "{{colors.tertiary_fixed_dim.default.hex}}"
teal = "{{colors.secondary.default.hex}}"
sky = "{{colors.secondary_fixed_dim.default.hex}}"
sapphire = "{{colors.secondary_fixed_dim.default.hex}}"
lavender = "{{colors.inverse_primary.default.hex}}"
# Text shades
text = "{{colors.on_surface.default.hex}}"
subtext1 = "{{colors.on_surface_variant.default.hex}}"
subtext0 = "{{colors.outline.default.hex}}"
# Surface shades
overlay2 = "{{colors.outline.default.hex}}"
overlay1 = "{{colors.outline.default.hex}}"
overlay0 = "{{colors.surface_variant.default.hex}}"
surface2 = "{{colors.surface_variant.default.hex}}"
surface1 = "{{colors.surface_variant.default.hex}}"
surface0 = "{{colors.surface.default.hex}}"
base = "{{colors.surface.default.hex}}"
mantle = "{{colors.surface.default.hex}}"
crust = "{{colors.on_primary.default.hex}}"
+49 -1
View File
@@ -4,7 +4,7 @@
if [ "$#" -lt 1 ]; then
# Print usage information to standard error.
echo "Error: No application specified." >&2
echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|fuzzel|walker|pywalfox|cava|yazi|labwc|niri|hyprland|sway|scroll|mango|btop|zathura} [dark|light]" >&2
echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|starship|fuzzel|walker|pywalfox|cava|yazi|labwc|niri|hyprland|sway|scroll|mango|btop|zathura} [dark|light]" >&2
exit 1
fi
@@ -534,6 +534,54 @@ zathura)
done
;;
starship)
PALETTE_FILE="$HOME/.cache/noctalia/starship-palette.toml"
CONFIG_FILE="$HOME/.config/starship.toml"
# Check if the generated palette file exists
if [ ! -f "$PALETTE_FILE" ]; then
echo "Error: Starship palette file not found at $PALETTE_FILE" >&2
exit 1
fi
MARKER_BEGIN="# >>> NOCTALIA STARSHIP PALETTE >>>"
MARKER_END="# <<< NOCTALIA STARSHIP PALETTE <<<"
# Create config file if it doesn't exist
if [ ! -f "$CONFIG_FILE" ]; then
mkdir -p "$(dirname "$CONFIG_FILE")"
echo 'palette = "noctalia"' > "$CONFIG_FILE"
echo "" >> "$CONFIG_FILE"
echo "$MARKER_BEGIN" >> "$CONFIG_FILE"
cat "$PALETTE_FILE" >> "$CONFIG_FILE"
echo "$MARKER_END" >> "$CONFIG_FILE"
exit 0
fi
# 1. Set palette = "noctalia" at top level
if grep -qE '^palette\s*=' "$CONFIG_FILE"; then
sed -i -E 's/^palette\s*=.*/palette = "noctalia"/' "$CONFIG_FILE"
else
# Insert after schema line if present, otherwise at line 1
if grep -qE '^\"\$schema\"' "$CONFIG_FILE"; then
sed -i '/^\"\$schema\"/a palette = "noctalia"' "$CONFIG_FILE"
else
sed -i '1i palette = "noctalia"' "$CONFIG_FILE"
fi
fi
# 2. Remove existing noctalia palette block (between markers)
if grep -qF "$MARKER_BEGIN" "$CONFIG_FILE"; then
sed -i "/$(echo "$MARKER_BEGIN" | sed 's/[[\.*^$()+?{|]/\\&/g')/,/$(echo "$MARKER_END" | sed 's/[[\.*^$()+?{|]/\\&/g')/d" "$CONFIG_FILE"
fi
# 3. Append the new palette block
echo "" >> "$CONFIG_FILE"
echo "$MARKER_BEGIN" >> "$CONFIG_FILE"
cat "$PALETTE_FILE" >> "$CONFIG_FILE"
echo "$MARKER_END" >> "$CONFIG_FILE"
;;
*)
# Handle unknown application names.
echo "Error: Unknown application '$APP_NAME'." >&2
+8
View File
@@ -64,6 +64,14 @@ Singleton {
"predefinedTemplatePath": "terminal/wezterm-predefined.toml",
"outputPath": "~/.config/wezterm/colors/Noctalia.toml",
"postHook": `${templateApplyScript} wezterm`
},
{
"id": "starship",
"name": "Starship",
"templatePath": "terminal/starship.toml",
"predefinedTemplatePath": "terminal/starship-predefined.toml",
"outputPath": "~/.cache/noctalia/starship-palette.toml",
"postHook": `${templateApplyScript} starship`
}
]