Skip to content

Commit a914779

Browse files
authored
Merge pull request #2235 from w453y/theme
2 parents b55db47 + 4972652 commit a914779

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

clean_files.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ themes/easy
163163
themes/essential
164164
themes/githelpers.theme.bash
165165
themes/inretio
166+
themes/lambda
166167
themes/modern
167168
themes/norbu
168169
themes/oh-my-posh
@@ -172,6 +173,7 @@ themes/powerline
172173
themes/pure
173174
themes/purity
174175

176+
175177
# vendor init files
176178
#
177179
vendor/.gitattributes

themes/lambda/lambda.theme.bash

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
# shellcheck disable=SC1090,SC2034
3+
4+
function set_prompt {
5+
local user_color="\[\033[1;31m\]" # bold red for username
6+
local at_color="\[\033[1;37m\]" # bold white for @ symbol
7+
local host_color="\[\033[1;31m\]" # bold red for hostname
8+
local in_color="\[\033[1;37m\]" # bold white for "in"
9+
local dir_color="\[\033[1;35m\]" # bold purple for current working directory
10+
local git_color="\[\033[1;36m\]" # bold cyan for Git information
11+
local time_color="\[\033[1;32m\]" # bold green for time taken
12+
local reset_color="\[\033[0m\]" # reset color
13+
local prompt_symbol_color="\[\033[1;31m\]" # bold red for the prompt symbol
14+
15+
local end_time=$(date +%s%3N) # current time in milliseconds
16+
local time_taken=$(( (end_time - start_time) )) # time in milliseconds
17+
18+
PS1="${user_color}╭─\\u" # username
19+
PS1+="${at_color}@${host_color}\\h" # @ symbol and hostname
20+
PS1+="${in_color} in" # "in" between hostname and current directory
21+
PS1+="${dir_color} \\w" # current working directory
22+
23+
# Git information (status symbol)
24+
PS1+=" ${git_color}$(__git_ps1 "[%s]")${reset_color}"
25+
26+
if [ $time_taken -gt 0 ]; then
27+
PS1+=" ${time_color}took ${time_taken}ms" # time taken in milliseconds
28+
fi
29+
30+
PS1+="\n${prompt_symbol_color}╰─λ${reset_color} " # red color for the prompt symbol, reset color after
31+
}
32+
33+
PROMPT_COMMAND='start_time=$(date +%s%3N); set_prompt'

0 commit comments

Comments
 (0)