Skip to content

Commit

Permalink
Merge pull request #2235 from w453y/theme
Browse files Browse the repository at this point in the history
  • Loading branch information
seefood authored Nov 6, 2024
2 parents b55db47 + 4972652 commit a914779
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ themes/easy
themes/essential
themes/githelpers.theme.bash
themes/inretio
themes/lambda
themes/modern
themes/norbu
themes/oh-my-posh
Expand All @@ -172,6 +173,7 @@ themes/powerline
themes/pure
themes/purity


# vendor init files
#
vendor/.gitattributes
33 changes: 33 additions & 0 deletions themes/lambda/lambda.theme.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# shellcheck disable=SC1090,SC2034

function set_prompt {
local user_color="\[\033[1;31m\]" # bold red for username
local at_color="\[\033[1;37m\]" # bold white for @ symbol
local host_color="\[\033[1;31m\]" # bold red for hostname
local in_color="\[\033[1;37m\]" # bold white for "in"
local dir_color="\[\033[1;35m\]" # bold purple for current working directory
local git_color="\[\033[1;36m\]" # bold cyan for Git information
local time_color="\[\033[1;32m\]" # bold green for time taken
local reset_color="\[\033[0m\]" # reset color
local prompt_symbol_color="\[\033[1;31m\]" # bold red for the prompt symbol

local end_time=$(date +%s%3N) # current time in milliseconds
local time_taken=$(( (end_time - start_time) )) # time in milliseconds

PS1="${user_color}╭─\\u" # username
PS1+="${at_color}@${host_color}\\h" # @ symbol and hostname
PS1+="${in_color} in" # "in" between hostname and current directory
PS1+="${dir_color} \\w" # current working directory

# Git information (status symbol)
PS1+=" ${git_color}$(__git_ps1 "[%s]")${reset_color}"

if [ $time_taken -gt 0 ]; then
PS1+=" ${time_color}took ${time_taken}ms" # time taken in milliseconds
fi

PS1+="\n${prompt_symbol_color}╰─λ${reset_color} " # red color for the prompt symbol, reset color after
}

PROMPT_COMMAND='start_time=$(date +%s%3N); set_prompt'

0 comments on commit a914779

Please sign in to comment.