2 Commits
dev ... 1.0

Author SHA1 Message Date
080843310c UPD report time > 3s 2025-06-22 11:24:44 +02:00
f638d8c652 DEL variable now 2025-06-22 09:11:54 +02:00

View File

@@ -1,5 +1,5 @@
# smd.zsh-theme, based on smt.zsh-theme, based on dogenpunk by Matthew Nelson. # smd.zsh-theme, based on smt.zsh-theme, based on dogenpunk by Matthew Nelson.
REPORTTIME=3
MODE_INDICATOR="%{$fg_bold[red]%}%{$reset_color%}%{$fg[red]%}%{$reset_color%}" MODE_INDICATOR="%{$fg_bold[red]%}%{$reset_color%}%{$fg[red]%}%{$reset_color%}"
local return_status="%{$fg[red]%}%(?..%?⏎)%{$reset_color%} " local return_status="%{$fg[red]%}%(?..%?⏎)%{$reset_color%} "
@@ -34,7 +34,7 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
# use a neutral color, otherwise colors will vary according to time. # use a neutral color, otherwise colors will vary according to time.
function git_time_since_commit() { function git_time_since_commit() {
local COLOR MINUTES HOURS DAYS SUB_HOURS SUB_MINUTES local COLOR MINUTES HOURS DAYS SUB_HOURS SUB_MINUTES
local last_commit now seconds_since_last_commit local last_commit seconds_since_last_commit
# Only proceed if there is actually a commit # Only proceed if there is actually a commit
if ! last_commit=$(command git -c log.showSignature=false log --pretty=format:'%at' -1 2>/dev/null); then if ! last_commit=$(command git -c log.showSignature=false log --pretty=format:'%at' -1 2>/dev/null); then
@@ -43,8 +43,7 @@ function git_time_since_commit() {
fi fi
# Totals # Totals
now=$(date +%s) seconds_since_last_commit=$(( $(date +%s) - last_commit ))
seconds_since_last_commit=$(( now - last_commit ))
MINUTES=$(( seconds_since_last_commit / 60 )) MINUTES=$(( seconds_since_last_commit / 60 ))
HOURS=$(( MINUTES / 60 )) HOURS=$(( MINUTES / 60 ))