home
/
code
/
khome.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add functions to list Bluetooth devices
[khome.git]
/
bin
/
today
diff --git
a/bin/today
b/bin/today
index
74640e0
..
f9c2d28
100755
(executable)
--- a/
bin/today
+++ b/
bin/today
@@
-51,16
+51,21
@@
weather_fetch() {
2> /dev/null
}
2> /dev/null
}
+weather_file_age() {
+ echo $(( $(date +%s) - $(stat -c '%Y' "$FILE_WEATHER") ))
+}
+
weather_get_or_fetch() {
weather_get_or_fetch() {
- weather_file_age=$(( $(date +%s) - $(stat -c '%Y' "$FILE_WEATHER") ))
weather_file_age_limit=$(( 3 * 60 * 60 ))
weather_file_age_limit=$(( 3 * 60 * 60 ))
- if [[ ! -e $FILE_WEATHER ||
$
weather_file_age -ge $weather_file_age_limit ]]
+ if [[ ! -e $FILE_WEATHER || weather_file_age -ge $weather_file_age_limit ]]
then
weather_fetch
fi
cat "$FILE_WEATHER"
}
then
weather_fetch
fi
cat "$FILE_WEATHER"
}
+weather="$(weather_get_or_fetch)"
+
clear
#LANG="$ts_lang" ncal -M $(date +%Y)
LANG="$ts_lang" ncal -M
clear
#LANG="$ts_lang" ncal -M $(date +%Y)
LANG="$ts_lang" ncal -M
@@
-77,5
+82,5
@@
echo "$ip_addresses"
echo "$bar"
echo ''
echo "Fetched on: $(stat -c %y $FILE_WEATHER)"
echo "$bar"
echo ''
echo "Fetched on: $(stat -c %y $FILE_WEATHER)"
-echo "$
(weather_get_or_fetch)
"
+echo "$
weather
"
echo ''
echo ''
This page took
0.0403480000000001 seconds
and
4
git commands to generate.