Skip to content

Commit

Permalink
Merge pull request #16 from n3tuk/update-starship-config
Browse files Browse the repository at this point in the history
Update starship colour schemes
  • Loading branch information
jonathanio authored Mar 16, 2024
2 parents 29d7c1b + 298406c commit b1c64f3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 41 deletions.
2 changes: 1 addition & 1 deletion plays/group_vars/development.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
env_name: development
env_location: cym-south-1
env_colour: d08770
env_colour: yellow
2 changes: 1 addition & 1 deletion plays/group_vars/production.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
env_name: production
env_location: cym-south-1
env_colour: bf616a
env_colour: red
2 changes: 1 addition & 1 deletion plays/group_vars/services.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
env_name: services
env_location: cym-south-1
env_colour: ebcb8b
env_colour: yellow
70 changes: 32 additions & 38 deletions roles/starship/templates/starship.toml.jinja
Original file line number Diff line number Diff line change
@@ -1,69 +1,63 @@
# {{ ansible_managed }}

# Configure the prompt display for the left-hand-side of the terminal
add_newline = true
format = """
{%- if directory == "root" %}
[╭╴](fg:#bf616a)$time[╶─╴](fg:#bf616a)[ ](fg:#5e81ac)$directory [╶─╴](fg:#bf616a)$shell
[│ ](fg:#bf616a)[ ](fg:#5e81ac)[╶─╴](fg:#eceff4)[{{ env_location | default('unknown') }}](fg:#eceff4)
[│ ](fg:#bf616a)[ ](fg:#5e81ac)[╶─╴](fg:#eceff4)[{{ env_name | default('unknown') }}](fg:#{{ env_colour | default('d8dee9') }})[/](fg:#5e81ac)[{{ env_purpose | default('unknown') }}](fg:#eceff4)
[╰╴](fg:#bf616a)$username$hostname $character
{%- else -%}
[╭╴](fg:#5e81ac)$time[╶─╴](fg:#5e81ac)[ ](fg:#5e81ac)$directory [╶─╴](fg:#5e81ac)$shell
[│ ](fg:#5e81ac)[ ](fg:#5e81ac)[╶─╴](fg:#eceff4)[{{ env_location | default('unknown') }}](fg:#eceff4)
[│ ](fg:#5e81ac)[ ](fg:#5e81ac)[╶─╴](fg:#eceff4)[{{ env_name | default('unknown') }}](fg:#{{ env_colour | default('d8dee9') }})[/](fg:#5e81ac)[{{ env_purpose | default('unknown') }}](fg:#eceff4)
[╰╴](fg:#5e81ac)$username$hostname $character
{%- endif -%}
╭╴$time  $shell  $directory
│ [ ](fg:blue)  [{{ env_name | default('unknown') }}](fg:{{ env_colour | default('white') }})[/](fg:bright black){{ env_purpose | default('unknown') }}
│ [ ](fg:blue)  {{ env_location | default('unknown') }}
╰╴$username$hostname $character
"""

# Configure the prompt display for the right-hand-side of the terminal
right_format = "[ ](fg:#d8dee9)$cmd_duration"

# General configuration options
add_newline = true
{% if directory == "root" %}
right_format = " $cmd_duration$sudo"
{% else %}
right_format = " $cmd_duration"
{% endif %}

[time]
disabled = false
format = "[$time](fg:#d8dee9)"
format = "$time"

[shell]
disabled = false
format = "[$indicator](fg:#5e81ac)"
fish_indicator = "fish"
bash_indicator = "bash"
unknown_indicator = "?sh"
format = "$indicator"
fish_indicator = "[fish](fg:blue)"
bash_indicator = "[bash](fg:red)"
unknown_indicator = "[unknown](fg:red)"

[directory]
disabled = false
format = "[$path](fg:#eceff4)"
format = "[ ]($style) $path"
{% if directory == "root" %}
style = "fg:red"
{% else %}
style = "fg:blue"
{% endif %}
home_symbol = "~"
truncate_to_repo = true
truncation_length = 15
repo_root_format = "[](fg:#5e81ac)[$repo_root](fg:#5e81ac)[$path](fg:#eceff4)"
repo_root_style = "x" # This is required to enable repo_root_format

[username]
show_always = true
format = "[$user]($style)"
style_user = "fg:#5e81ac"
style_root = "fg:#bf616a"
style_user = "fg:blue"
style_root = "fg:red"

[hostname]
disabled = false
format = " [on](fg:#eceff4) [$hostname](fg:#bf616a)"
format = " on [$hostname]($style)"
{% if directory == "root" %}
style = "fg:red"
{% else %}
style = "fg:blue"
{% endif %}
trim_at = ""
ssh_only = false

[character]
disabled = false
success_symbol = "[](fg:#d8dee9)"
error_symbol = "[](fg:#bf616a)"

[cmd_duration]
disabled = false
format = "[$duration](fg:#5e81ac)"
success_symbol = ""
error_symbol = "[](fg:red)"
{% if directory != "root" %}

[sudo]
disabled = false
format = "[ ](fg:#eceff4)[ ](fg:#bf616a)"
format = "[ ](fg:red)"
{% endif %}

0 comments on commit b1c64f3

Please sign in to comment.