DEL variable now

This commit is contained in:
2025-06-22 09:11:54 +02:00
parent 359d03f433
commit f638d8c652

View File

@@ -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 ))