42 lines
756 B
Plaintext
42 lines
756 B
Plaintext
|
|
generate-year.sh
|
|
----------------
|
|
|
|
usage:
|
|
./generate-year [year]
|
|
|
|
parameter [year] is optional, omit to use current year
|
|
|
|
generate-week.sh
|
|
----------------
|
|
|
|
cron usage:
|
|
|
|
1 0 * * 1 TEMPLATE="dhis2 7.5" TIME_DIR=~/plan/time /home/varl/bin/generate-week.sh write
|
|
|
|
user alias:
|
|
|
|
function te () {
|
|
$EDITOR ~/plan/time/current.timedot
|
|
}
|
|
|
|
user alias
|
|
----------
|
|
|
|
add to e.g. .zshrc:
|
|
|
|
function te {
|
|
local date=${1:-$(date -I)}
|
|
local year=$(date -d $date +%Y)
|
|
|
|
local timedir="$HOME/plan/time"
|
|
local archivedir="$timedir/archive"
|
|
|
|
if [[ $year < $(date +%Y) ]]; then
|
|
vim -c "/$date" $archivedir/$year.timedot
|
|
fi
|
|
|
|
vim -c "/$date" $timedir/$year.timedot
|
|
}
|
|
|