|
|
|
@ -30,9 +30,13 @@ output() {
|
|
|
|
|
echo "%{F$color}$symbol $difference%%{F$COLOR15}" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Only pull if older than 10 seconds |
|
|
|
|
lastModified=$(calc "$(date +%s) - $(date +%s -r $file) >= 10" | cut -c 1) |
|
|
|
|
if [ "$lastModified" -eq 0 ]; then cat "$file"; exit; fi |
|
|
|
|
if [ ! -f "$file" ]; then |
|
|
|
|
touch "$file" |
|
|
|
|
else |
|
|
|
|
# Only pull if older than 10 seconds |
|
|
|
|
lastModified=$(calc "$(date +%s) - $(date +%s -r $file) >= 10" | cut -c 1) |
|
|
|
|
if [ "$lastModified" -eq 0 ]; then cat "$file"; exit; fi |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Get dates |
|
|
|
|
date_last_week_start="$(date --date 'last week' +%s000)" |
|
|
|
|