~lucasemmoreira/pomodoro

0a279239235502306b9c3ee24a06ddd205aa3dd0 — lucas 7 months ago 42d1ad2 master
change: improve time control, more readme
3 files changed, 9 insertions(+), 3 deletions(-)

M README.md
M src/pomodoro
M src/pomodoro-viewer
M README.md => README.md +5 -0
@@ 16,8 16,13 @@ To install `make install`, then run it with `pomodoro`.

`pomodoro` is a fairly simple shell script that will sleep for the time of the `POMODORO_TIME`, and at the end will pop a rofi screen that will ask you what you did and in which project. All this information will be saved in your `$HOME/.config/pomodoro/worklog.csv`, to later be seen with `pomodoro-viewer`. 

Notes:

- If there is not a project in the rofi project window, just type a new one. That particular window just looks for the projects already typed so it help you not create typos.

## Todos

- [X] Create an optional argument to save how the tool was used?
  This was changed. Now one file to control everything.
- [ ] Add a config file to control time, settings etc
- [ ] In configuration, allow to write what to do before it starts

M src/pomodoro => src/pomodoro +3 -2
@@ 23,7 23,7 @@ choice1stlong(){
logwork(){
    work=$(rofi -dmenu -p "what did you do?")
    project=$(cat "${DIR}/projects.csv" | rofi -dmenu -i -p "In what project?")
    echo "${1} ${2},$(date +"%Y-%m-%d %H:%M:%S"),${project}, ${work}" >> "${DOLOG}"
    echo "${1} ${2},${3} ${4},${project}, ${work}" >> "${DOLOG}"
}

timeforlongbreak(){


@@ 34,9 34,10 @@ pomodoro(){
    $NOTIFY "o/ pomodoro started. Focus!"
    START_TIME=$(date +"%Y-%m-%d %H:%M:%S")
    sleep $((${POMODORO_TIME}*60))
    END_TIME=$(date +"%Y-%m-%d %H:%M:%S")
    cat ${DOLOG} | awk -F',' '{ print $3 }' | sort | uniq > "${DIR}/projects.csv"
    $NOTIFY "whoa! nice doing!"
    logwork $START_TIME
    logwork $START_TIME $END_TIME
    if timeforlongbreak; then
	choice1stshort
    else

M src/pomodoro-viewer => src/pomodoro-viewer +1 -1
@@ 5,4 5,4 @@ PROJECT="${DIR}/worklog.csv"

last_day=$(cat $PROJECT | awk -F ',' '{print $1}'| sed s/\ .*//g | uniq | sort -r | rofi -dmenu -i -p "Which day?")

ag --nonumbers $last_day $PROJECT | awk -F ',' '{print $2 $3 $4}' | rofi -dmenu -p "here's what you did last day ($last_day) =]"
ag --nonumbers $last_day $PROJECT | awk -F ',' '{print $2 " " $3 " " $4}' | rofi -dmenu -p "here's what you did last day ($last_day) =]"