-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompte
More file actions
executable file
·29 lines (24 loc) · 773 Bytes
/
Copy pathprompte
File metadata and controls
executable file
·29 lines (24 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/zsh
function promptoid() {
echo "%K{${1}}%F{${2}}${3}%k%f"
}
function promptina() {
local nl=$'\n'
local mer=$(date '+%p' | tr '[:upper:]' '[:lower:]')
case "$1" in
"dark")
local clk=$(promptoid 0 1 " %D{%I:%M}${mer} ")
local zsh=$(promptoid 0 2 " zsh ")
local me=$(promptoid 0 4 " %n ")
local us=$(promptoid 0 6 " %m ")
;;
"light")
local clk=$(promptoid 0 9 "[ %D{%I:%M}${mer} ]")
local zsh=$(promptoid 0 10 "[ zsh ]")
local me=$(promptoid 0 12 "[ %n ]")
local us=$(promptoid 0 14 "[ %m ]")
;;
esac
echo "${nl}${clk}${zsh}${me}${us}${nl}%F{7}┌── %~${nl}└─%f "
}
PROMPT="$(promptina light)"