Storing history of each pomodoro
We discussed it: https://mamot.fr/@vjousse/114733255480315440
Is it possible to store the history of each pomodoro with a description field?
I would like keep track of what I have done. Here is a use case:
pomo 25 "some string" will:
- start pomodorolm,
- store the time stamp from ~/.cache/pomodoro_session (where? ~/.my_pomodoro),
- do a cycle including a "short break"
- stop the process (for now I think we are doing a cycle of 4 rounds, do a CLI to specify it)
Then: pomo 25 "a new string" (repeat).
I do not have any specific idea on "how". I was going to do a quick personal shell script for it (and maybe that is better since everyone has their specific workflow). I was thinking that my_pomodoro would look like
starting_datetime ; description; ending_dateteime
Mon Jun 23 11:09:45 AM EDT 2025; some, string; Mon Jun 23 11:39:45 AM EDT 2025
Mon Jun 23 11:39:45 AM EDT 2025; a new string; <empty when not finished>
I wrote something that is "working" now. The use of trap in not pretty but I hope it can help understand a bit more the use of a potential CLI.
I changed the structure of the history to match a a simple append.
#! /bin/bash
set -e
reminder() {
echo "Nop: ./pomo.sh 25 'string'"
}
if [ "$#" -ne 2 ]; then
reminder
exit 1
fi
if [ -f ~/.cache/pomodoro_session ]; then
echo "pomodorolm is running"
exit
fi
# timer=$1 # right now do nothing: scaffolding to specify time
# should be a default
description=$2
HISTORY=~/.my_pomodoro
if [ -f $HISTORY ]; then
cat $HISTORY # maybe change to wc since it will grow
else
echo "Init $HISTORY"
echo "date; action; description" > $HISTORY
fi
echo "start pomodorolm"
echo "$(date); start; $description;" >> $HISTORY
my_exit() {
echo "$(date); end; $description;" >> $HISTORY
}
trap 'my_exit' EXIT
pomodorolm
Thanks for the script! I’m currently working on it! https://github.com/vjousse/pomodorolm/pull/176
Great! I am using this right now (https://codeberg.org/defuneste/scripts/src/branch/main/pomo) still a lot of scaffolding but it is working fine. I am excited to adapt it!
Thanks for the script but I may be missing something as it looks like you’re running the gui and not pomodorolm cli, how is it supposed to work?
Yup, I either use "quit" in the GUI or kill the GUI. I think I also like to have the little colored "wheel/clock" on my toolbar.
It is far from perfect, what I want is a file that store my past pomodoro. I will try to explain my workflow now.
I am using a windows manager (and I put that "workflow" in a specific window):
- I open a terminal
- Start the script (
pomo 25 something). a. The script will append my file with $date, a type of action (just "start" and "end" now) and a $description (second argument) b. start pomodorolm c. I need to press "play", pain point d. I am using wither "quit" on the toolbar or ctrl+c on my shell e.trap "my_crappy_function" exitwill record the $date the end of my cycle and keep the same description - If i want to send an other cycle I just move to the windows, go in the shell (
pomo 25 new stuff)
It is far from perfect! The "pain" point is that I need to start/stop manually pomodorolm while I would like to just have "one cycle" by default (and maybe use option to change that). Obv. my script is not linked to ~/.cache/pomodoro_session that I also could use. I just tough it was easier to use a very imperative simple script for now.
This is an example of the last line of my "history file":
Fri Jun 27 09:30:40 AM EDT 2025; start; leetcode;
Fri Jun 27 09:55:50 AM EDT 2025; end; leetcode;
Fri Jun 27 09:56:00 AM EDT 2025; start; job appliction;
Fri Jun 27 10:25:06 AM EDT 2025; end; job appliction;
As you can see I should remove the last semi colon, could be good to have a unique ID for a pomodoro (not that hard, I was just not prioritizing that).
I am happy to get any hint on how to improve on that!
Oh great! I hadn't really understood how you were using it 😊 I thought you were using the CLI but now I get it ^^
The ~/.cache/pomodoro_session file is only used by the CLI for now, the UI has a totally different way of managing the sessions, I’m planning to use ~/.cache/pomodoro_session for both later on.
If you want to use the GUI, I can implement some simple improvements :
- Add a config value that will allow to automatically start a pomodoro on app startup
- Add a config value that will automatically quit pomodorolm after a focus session (or after the break? not sure about that)
What do you think?
I am still unclear on what is the best use for me. I would like the CLI since it seems easier for me to grab arguments from here (or provide arguments) but I kind of like the small GUI timer now that I have tried it.
I like the idea of starting automatically a pomodoro on app startup, I think most people are doing that but I could be wrong (the case against is people organizing a session).
I think it should be after break since it is part of the design: you work, you take a break (repeat).
How does the config get accessed? I.E. can I read/parse it from a shell and update it?
(I think it is a great idea to use the ~/.cache/pomodoro_session for both GUI/CLI)
Sure the config file is a simple toml stored here: ~/.config/pomodorolm/config.toml
Ok I’ll have a look at implementing the auto start/stop function, should not be that hard, and it could already enhance your workflow a little bit!
@defuneste the auto-start/auto-quit function was implemented in 0.6.0, don’t hesitate to give some feedback when you can!
Great, a bit busy this week but I will try to save some pomodoro for it! Thanks a lot!