mirror of https://github.com/akelge/zsh
Fix prompts and a minor alignment in gitfetch
This commit is contained in:
parent
4a7b17c07b
commit
8d0b2db580
|
@ -14,9 +14,10 @@ blocks:
|
|||
style: plain
|
||||
foreground: yellow
|
||||
properties:
|
||||
postfix: ' '
|
||||
postfix: ""
|
||||
prefix: ""
|
||||
template: '{{if .SSHSession}}@{{ .ComputerName }}{{end}}'
|
||||
template: '{{if .SSHSession}}@{{ .ComputerName }} {{end}}'
|
||||
|
||||
|
||||
- type: root
|
||||
style: plain
|
||||
|
@ -25,9 +26,12 @@ blocks:
|
|||
postfix: ""
|
||||
prefix: ""
|
||||
root_icon: "\u26A1"
|
||||
# root_icon: "# "
|
||||
|
||||
- type: path
|
||||
style: plain
|
||||
# style: agnoster_left
|
||||
max_depth: 2
|
||||
foreground: lightBlue
|
||||
properties:
|
||||
prefix: ""
|
||||
|
@ -35,23 +39,24 @@ blocks:
|
|||
|
||||
- type: git
|
||||
style: plain
|
||||
foreground: darkGray
|
||||
foreground: yellow
|
||||
properties:
|
||||
branch_ahead_icon: <#88C0D0>⇧ </>
|
||||
branch_behind_icon: <#88C0D0>⇩ </>
|
||||
branch_icon: "\uE0A0"
|
||||
branch_ahead_icon: <#88C0D0>⇡</>
|
||||
branch_behind_icon: <#88C0D0>⇣</>
|
||||
branch_icon: ""
|
||||
display_status: true
|
||||
fetch_status: true
|
||||
prefix: ""
|
||||
template: '{{ .HEAD }}{{.BranchStatus}}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{if .Staging.Changed }}{{ .Staging.String }}{{ end }}'
|
||||
template: '{{ .HEAD }}{{.BranchStatus}}{{ if .Working.Changed }}<#FF0000>* {{ .Working.String }}</>{{ end }}'
|
||||
# template: '{{.BranchStatus}}{{ if .Working.Changed }}<#FF0000>* {{ .Working.String }}</>{{ end }}'
|
||||
|
||||
- type: executiontime
|
||||
style: plain
|
||||
foreground: darkGray
|
||||
foreground: yellow
|
||||
properties:
|
||||
always_enabled: false
|
||||
postfix: ""
|
||||
prefix: "\uF017 "
|
||||
prefix: " "
|
||||
style: austin
|
||||
threshold: 30000
|
||||
|
||||
|
@ -61,32 +66,28 @@ blocks:
|
|||
|
||||
- type: aws
|
||||
style: plain
|
||||
foreground: yellow
|
||||
foreground: "#ffA000"
|
||||
properties:
|
||||
postfix: ""
|
||||
# prefix: " "
|
||||
prefix: "\u2601 "
|
||||
prefix: " "
|
||||
# prefix: " "
|
||||
template: '{{if .Profile}}{{.Profile}}{{end}}'
|
||||
|
||||
- type: kubectl
|
||||
style: plain
|
||||
foreground: magenta
|
||||
foreground: lightBlue
|
||||
properties:
|
||||
parse_kubeconfig: true
|
||||
postfix: ""
|
||||
prefix: " "
|
||||
template: '{{if eq "on" .Env.KUBE_PS1_ENABLED}}ﴱ {{.Context}}/{{if .Namespace}}{{.Namespace}}{{else}}default{{end}}{{end}}'
|
||||
|
||||
# - type: command
|
||||
# style: plain
|
||||
# foreground: white
|
||||
# prefix: ""
|
||||
# postfix: ""
|
||||
# properties:
|
||||
# shell: /bin/sh
|
||||
# # command: "ifconfig utun2 > /dev/null 2>&1 && echo '\uF023' || echo ''"
|
||||
# command: "ifconfig utun2 > /dev/null 2>&1 && echo '\u2692' || echo ''"
|
||||
prefix: ""
|
||||
template: '{{if eq "on" .Env.KUBE_PS1_ENABLED}} ﴱ {{.Context}}/{{if .Namespace}}{{.Namespace}}{{else}}default{{end}}{{end}}'
|
||||
|
||||
- type: command
|
||||
style: plain
|
||||
foreground: white
|
||||
properties:
|
||||
shell: /bin/sh
|
||||
command: "ifconfig utun2 > /dev/null 2>&1 && echo '<#00FF00>\uF023</>' || echo '\0'"
|
||||
|
||||
- type: prompt
|
||||
alignment: left
|
||||
|
|
|
@ -28,8 +28,11 @@ blocks:
|
|||
root_icon: "\u26A1"
|
||||
# root_icon: "# "
|
||||
|
||||
|
||||
- type: path
|
||||
style: plain
|
||||
# style: agnoster_left
|
||||
max_depth: 2
|
||||
foreground: lightBlue
|
||||
properties:
|
||||
prefix: ""
|
||||
|
@ -46,6 +49,7 @@ blocks:
|
|||
fetch_status: true
|
||||
prefix: ""
|
||||
template: '{{ .HEAD }}{{.BranchStatus}}{{ if .Working.Changed }}<#FF0000>* {{ .Working.String }}</>{{ end }}'
|
||||
# template: '{{.BranchStatus}}{{ if .Working.Changed }}<#FF0000>* {{ .Working.String }}</>{{ end }}'
|
||||
|
||||
- type: executiontime
|
||||
style: plain
|
||||
|
@ -82,12 +86,11 @@ blocks:
|
|||
# - type: command
|
||||
# style: plain
|
||||
# foreground: white
|
||||
# prefix: ""
|
||||
# postfix: ""
|
||||
# properties:
|
||||
# shell: /bin/sh
|
||||
# # command: "ifconfig utun2 > /dev/null 2>&1 && echo '\uF023' || echo ''"
|
||||
# command: "ifconfig utun2 > /dev/null 2>&1 && echo '\u2713' || echo '\u2717'"
|
||||
# # command: "ifconfig utun2 > /dev/null 2>&1 && echo '<#00FF00>\u2713</>' || echo '\u2717'"
|
||||
# command: "ifconfig utun2 > /dev/null 2>&1 && echo '<#00FF00>\u2713</>' || echo ' '"
|
||||
|
||||
|
||||
- type: prompt
|
||||
|
|
|
@ -2,8 +2,13 @@ local _gitdir
|
|||
local last_fetch
|
||||
local diff
|
||||
|
||||
# exec 3>&1 4>&2
|
||||
# trap 'exec 2>&4 1>&3' 0 1 2 3
|
||||
# exec 1>>~/tmp/gitfetch.log 2>&1
|
||||
|
||||
cd $1
|
||||
|
||||
|
||||
gitdir=$(git rev-parse --git-dir 2> /dev/null) || return 0
|
||||
last_fetch=$(zstat +mtime $gitdir/FETCH_HEAD 2> /dev/null || echo 0)
|
||||
let "diff = $(strftime %s) - $last_fetch"
|
||||
|
@ -55,7 +60,7 @@ if [ $diff -gt ${GIT_FETCH_INTERVAL:-30} ]; then
|
|||
command git -c gc.auto=0 fetch \
|
||||
--quiet \
|
||||
--no-tags \
|
||||
--recurse-submodules=no \
|
||||
--recurse-submodules=yes \
|
||||
$remote &>/dev/null &
|
||||
wait $! || return $fail_code
|
||||
|
||||
|
|
Loading…
Reference in New Issue