docs: update readme

This commit is contained in:
Viktor Varland 2023-04-12 11:13:09 +02:00
parent ee50a30c78
commit 805a288f2d
Signed by: varl
GPG key ID: 7459F0B410115EE8
2 changed files with 41 additions and 40 deletions

40
README
View file

@ -1,40 +0,0 @@
generate-year.sh
----------------
usage:
./generate-year [year]
parameter [year] is optional, omit to use current year
user alias:
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
}
generate-week.sh
----------------
/!\ deprecated in favour of generate-year.sh.
cron usage:
1 0 * * 1 TEMPLATE="work 8" TIME_DIR=~/plan/time /home/varl/bin/generate-week.sh write
user alias:
function te () {
$EDITOR ~/plan/time/current.timedot
}

41
README.md Normal file
View file

@ -0,0 +1,41 @@
# log-time
[![asciicast](https://asciinema.org/a/576937.svg)](https://asciinema.org/a/576937)
## generate-year.sh
Generate timedot file with dates for current (or given) year, e.g.
`2023.timedot`.
A user alias to open vim on the current, or given, date is used to log
time and modify older entries.
```
usage:
./generate-year [year]
parameter [year] is optional, omit to use current year
```
user alias:
```
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
}
```
## generate-week.sh
Generate timedot file with dates for current week, e.g.
`2022-13.timedot`.