Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Time-tracker that helps me with context switches and documentation (github.com/tech-branch)
122 points by tomaszsobota on March 27, 2023 | hide | past | favorite | 54 comments
Hi HN!

I was feeling incredibly frustrated with my struggles in context-switching and writing documentation, so I decided to take action and find a solution.

I wrote a simple tool for Alfred and Raycast that helps me be more mindful when switching between tasks, which can even prevent some of those switches. Plus, I can jot down quick notes on each task as I go, making it easier to document everything once I’m finished.

This tool is really simple with only 5 commands - tsr, tsn, tsl, tsv, tse

tsr writes a new record

tsn writes a new note

tsl shows you the current task

tsv builds a static html page displaying a single timeline of the tasks and notes

tse opens the directory where records are stored for easy manual editing

TSR stores your data as simple csv files in ~/tsr, making it super easy to integrate with other tools or perform your own custom analysis and visualisation magic. The built-in tsv timeline visualisation is rather simple and doesn’t do any analysis (for now at least).

It depends solely on Python3 and works offline. I encourage you to check the python scripts to see how simple they are and potentially adapt them to your own needs.

Let me know what you think!




I really enjoy time tracking threads on HN, the domain is straightforward enough for every time there to be an absolutely different set off tools and approaches, without major incumbents dominating the field. The discussions always inspire me to think about my time tracking tool - https://github.com/Klaster1/timer-5 - in a different light and seek inspiration from others.


Feedback for the landing page:

Specify up front what it is, including what it is for. I don't recognize the UI in the animated screenshots. Does it require some special OS? Some special software for which it is a plugin? Is it a plugin for some other software?

The pitch at the top just says it's a csv based time recorder. But then it says "Just enter tsr [foo]" - but where? First I thought a shell. Then I thought the VSCode command palette.

I learned near the end that it's usable with both Alfred and Raycast but I don't know what those are either. And there is talk about Finder (Which I know is an OS X thing). This is a clue that I might not be able to use it - maybe I'm on the wrong OS?

My guess after studying the page is that it's a plugin for "Launchers" (is that a thing?) running under OS X, namely launchers "Alfred" and "Raycast"?` Perhaps a paragraph like that could be used up top?


Thanks, I should've been clearer about the fact they are plugins for OSX launchers. I'll definitely update the readme with this information :)

> "Launchers" (is that a thing?)

Yes, the Spotlight search in OSX is somewhat limited so tools like Alfred and Raycast are often used to make the search more fine-tuned to your needs (like being able to search through browser bookmarks and launch them easily) but also enable custom scripting


It would also be useful to link to Alfred and Raycast. The SEO for "Raycast" at least gave me that as the first result, "Alfred" however required two searches before I got a result and even then it was 5th in the list. Hyperlinks would have saved me 30 seconds! ;-)


I get the intention. The challenge for me is that I don’t have any notion of flicking from one task to another, so I’d install this and guaranteed use it once, maybe twice. Then poof, I’ve forgotten all about it and I’d rediscover it next time you post on HN.


Same. I vaguely remember a tool that would ask you what you were doing periodically. I never got it to run, so I don’t know if itd be useful or a distraction.


Manic Time is one such tool and the free version is completely without distraction. When you want you open it and get a colored timeline that you can hover over to see what program was active and the title of the active window.

I pay for professional to get a notification everytime I have been away from the keyboard for a while. Then I can manually tag that time and specify for myself if it is work related or not, and in case I work on multiple projects, which one it relates to. The paid version also gives me a summarized time sheet view of the week and can store screenshots if I want to (I use it, although if I need to use the screenshots for documentation, like when I had to configure live remote systems using Windows Notepad and with no access to VCS a few years ago, then I use something else that saves high resolution :-)


Ahh I found it: http://messymatters.com/tagtime/

The idea is that it's fully manual and only precise across weeks.


There are automations similar to MacOS. On the 4th time you're deep into a task and just click OK in the box ...


This makes me think maybe I should try to make the jump to a terminal-first way of using computers, i.e. get a laptop that boots to a Linux command line and make that my 'home screen'. Seems like it would force me to stop and think when task-switching. Desktop environments seem designed to trick my brain into flicking between different activities without noticing.


I would like a physical timer with a keep-alive button.

You can start the timer and it will count up. Every 15 minutes or so a bright and noticeable LED will light up. If I push the button the LED turns off and the timer continues. If I don't push the button the timer pauses. I have 5 minutes to push the button. (When the timer pauses it subtracts half the time since I last pushed the button.)

And make it a big clicky arcade-cabinet style button that is fun and easy to push.


I built a similar device (works more like the linked software), using illuminated buttons, and big RGB arcade button for the main action.

https://doug.lon.dev/software/hardware/2018/06/24/the-task-s...

I stopped using it about a year or so ago, I didn't feel the need to keep recording every context change, and I also never really looked at the reports or drew much of any conclusion about the data.

It would be reasonably simple to use my software on the desktop, or in another device, and add countdown feature. It's all open source.

In the end the device was a bit of a vehicle to learn new things; hardware development, aspects of the software and I also subsequently re-wrote the web service on AWS serverless as well.


It's the other way round but I use a time timer[1] to give me a visual indication of how much time is left. I usually put around 40 min & extend by 15~30min if I want to focus more. It doesn't have a big clicky button, but I find physically rotating the dial satisfying.

I've also experimented with iOS timer to stop playing music after the set time is up and that worked well as a non intrusive reminder too.

[1] https://www.timetimer.com/


Yeah, there's a thousand options for counting down, but there's nothing that counts up while ensuring that you're still on task. I'm sure there are some complicated apps that half work[0], but I want a physical device. I want to occasionally press an oh-so-satisfying physical button to attest that I'm still on task. This also solves the problem of forgetting and leaving the timer running, which destroys your record of how long you've worked. With my proposed device, the timer will stop by itself if you forget about it.

[0]: I say "half work" because an app can't ensure you're on task.


Hmm yeah I can see the appeal of something like that. I just had a look in my local Amazon and saw this study timer with a nice physical button which seems to have "Count up" functionality [1][2]. But it doesn't seem to have a feature to alert you while counting up.

[1] https://www.amazon.co.jp/-/en/dretec-T-580WTDI-Study-Timer-S...

[2] https://youtu.be/Ak_TjtWc8uo?t=294 (enable caption)


Not exactly what you want but I have a few of these: https://www.amazon.com/gp/aw/d/B016KDK7NA

It comes with vibration, beeps, and LED; each can be turned on or off separately. I have mine only set to LED. If it goes off I can stop it, which automatically sets the timer back to what I started it at. It doesn’t auto-pause or anything but it works for me!


I love this thing! There are few options for light only timers, and from the pictures I assumed it would just be easily breakable plastic junk, but it's actually pretty solidly built.


How about a big tactile egg timer that makes a noise when time is up and can be set to 20 or 30 minutes?

It could be semi-transparent with a RGB LED inside that moves from white to red over the last five minutes on the timer. Push the top to cycle a few different set tasks (indicated by led-color?), wind up to start. Power and data over USB?

I need to save up for a new 3d printer and build this for myself.


There are timer cubes that start when you put them on each side (5min, 15min, etc)


Intrigued, could you explain how you would use it so I can understand why you want it to function like this?


Also built something slightly similar - without the need to interact https://github.com/frans-fuerst/track Works on Linux with XOrg and Windows only unfortunately..


I like the demo. I also like very much that you try to keep the features down to a minimum as you write:

I tried a few other tools over the years, but the number of features they offer often distracted me from using it efficiently, making time tracking an effort on its own.

While tsr may not have an extensive list of features, it has proven to be effective for my needs, and I believe it may also benefit others in similar situations.

In that vein I wouldn't add any new features and seriously consider removing tsn.


Thank you, right on point, the notes functionality is something of a buffer now to let me backlog the interruptions for later.

Its current form is intentionally separate so that you can use tsr without it, but I'm still thinking what the best approach might be.

I wouldn't really want to remove the feature completely, but replacing it with a much lower footprint feature as part of tsr is something I'm actively thinking about.


This is how I track the time I spent on projects by analyzing the window titles.

1. Create a list of product names and folder names for each client.

2. Change settings of applications/window manager to include more details in window title.

3. Log every window I interact with.

4. If I don't open a window including one of the keywords in the title for x minutes I stop the counter.


I would recommend looking into org-mode for task-based time tracking and documentation (probably using org-capture), it's one of the basic use cases.


Do you have any recommendations on an example or tutorial on how org-mode this can be useful for time tracking?

I often see it recommended and I like the idea of a light-weight tracker (since I mainly use a .txt document now) - but whenever I read about org-mode it just sounds like a markup language and I know I am missing the powerful part of it.


I've been searching myself. The keywords that work well are "orgmode clocking".

Personaly I'm using VimOrganizer, which is a plugin for vim with some orgmode commands. I'm looking at the newer nvim orgmode as well. To check in in a task, i type ,ci for clocking. When I'm done, I type ,co for clocking out. This add a clock line to the node where the command is done.


Cool! I used to have my own back in 2005/2006 I remember. Mine was written in AHK and worked by periodically asking me what I was doing.

Since then I switched to Manic Time which just logs the open application and window title. (In the free version, more features in the paid version which I use now even if the free version is really good.)

The benefit of your approach and my AHK script is it encourages thinking about how one uses the time during the day and not only towards the end of the week when the timesheets are due.


Awesome, what was the interval that you found most comfortable/effective? (I imagine there was a lot of fine tuning)

I'm afraid Manic wouldn't help me personally because it doesn't interrupt the switches. tsr makes me stop for a second and write down the fact I'm jumping to another task. It's a tiny interruption, but occasionally it's enough to stop, make a tsn note and come back to it later. I feel this is a step in the right direction for me to stay on top of things.


I being me, I settled for 7 minutes which even I think is a short interval but I think empty records were OK so I could just hit enter which would mean "still working on the last thing I wrote".


I did something similar as an AutoHotkey[1] script on Windows[2].

I just hit Win+N, a small window appears, I write a line of text, hit enter and it gets saved to the quicklog.txt.

[1] https://www.autohotkey.com/

[2] https://gist.github.com/knagy/4cdb5af48e23a6b33299d3f2fb2d4f...

edit: replaced the inline code with a Gist link


Looks really cool Appreciate the gifs you created to demonstrate how it functions. I'm looking forward to use it with the Windows launcher once you adapt it.


Question: why? I read your post and the readme, but I still don’t know. Perhaps some background?

I’m unfamiliar with both Alfred and Raycast, and while a quick search tells me they are application launchers, that of itself tells me little, since I do not use any and don’t know what problem they solve.

Since I’ve been using Mac OS for many years, I’m guessing it’s a problem I don’t have or don’t know that I have.

Thoughts?


Application Launchers are cmd + space replacements that usually come with host of useful features and a plugin interface of some kind. They’re just better than Spotlight - period. Check out Raycast - it’s the new kid on the block. Alfred is old trusty and has been around for over 15 years.


I’ve never understood the use case for Spotlight either. In the past, on slower machines, I’ve disabled its index because it dragged down performance.

I think I’ve left it running on my Mini but I’ve never used it.

(When I need to find files, I find that find and grep get me what I need quickly.)


Well, this has been an interesting few minutes.... Years ago, I disabled Spotlight because I found it bogged down my Air, but this thread got me curious, so I reenabled Cmd-Space and tried a few things, and am impressed...

...and my poking about re Spotlight led to me Stage Manager and I am very, very pleased. While I've always been a cmd-tab and cmd-esc person, Stage Manager is a wickedly cool and elegant new tool in my toolbox. I love how neat everything suddenly is!

I suspect that after I have played with these a while, I will end up checking out Raycast.


I use ActivityWatch which has a browser and vs code plugin and it just tracks what i do by itself in the background. As soon as I spend a second having to do something with the time tracking software that is a second lost. It should be passive and in the background. It's by no means perfect and sometimes buggy.. but works for me.


This tool looks awesome, but this second I have to spend is exactly what I need to pause and note the interruption down for later.

Otherwise, the pile of outstanding requests and mentions is stacking up enough that I'd forget about half of them if I don't have them written down neatly. But at the same time, I want the writing down to be easy enough to not get me out of the flow.


Nice one! I made something somewhat related a while back... I still use it.

https://github.com/keyle/mdtimesheet

There is nothing like solving your own problems.


I really like Tyme for time tracking. It works quite well for me, is dirt cheap, has a great UX across both my iphone and my macbook and gives me flexibility around start and end times so it's easy to keep it roughly accurate.

That said, I don't use it for detailed task observation. For example while writing this my "management" timer is running and this is definitely not managing my team. I use it for directionality more than anything else.


I'm using gtimelog for this. Similarly, I don't need a minute-precise account of my time, but it helps to get a rough overview where my time is going - system maintenance, incidents, project work, organization - or what time certain infamous internal projects really consume using the tags.


Great idea! I would use it without a second thought if this could take my notes and push them into the my Daily Obsidian note, along with timestamps. :D


Now that's an interesting thought, I encourage you to check the script and see the only thing you'd have to do to achieve this is add

   obsidian_file = open(FILE_PATH, "a")
   _ = obsidian_file.write(output)
   obsidian_file.close()
At the end of TSR and TSN. Where FILE_PATH is your vault location.

The above is for Raycast. For Alfred, you can just copypaste relevant extension blocks and change paths in them :)


I don’t know what Alfred and Raycast are but if I could type it at the command line then makes sense to me and is useful.


Certainly, it's meant to be as simple as possible so the scripts in `raycast` can be taken as they are and executed in the command line

   ./tsr.py "meeting client migration"


Anyone also using Timewarrior? It's FOSS, command-line and also dead simple.


Is there a launcher for Windows that can run this?


This certainly could be adapted to one of the launchers for Windows.

The only problem is there are so many of them and each treats extensions so differently that I'm still looking for something similar to Raycast I could settle on.

Do you know of any launchers that are widely used on Windows?


I've used PowerToys Run before but struggling to understand how I would integrate this.


Oh I didn't know there's a native launcher on Windows :o thank you so much for sharing this.

I'll sit down to this over the next few evenings and try to see if I can run python scripts with it. (or at least powershell commands, that'd temporarily sacrifice `tsv` but I'll figure this out eventually)


I did some research, it looks like you can run PowerShell commands with > i.e "> ping 127.0.0.1"


Is there a launcher for Windows?


Is there a way to pause/end a task?


Yes, if you just do an empty tsr with no parameters it'll create a 'next' entry by default which marks a new task.

You can 'come back' to the previous task (or rather start it again) by typing the same tags into tsr.

   tsr work feature 1425
   tsr
   tsr work feature 1425
the empty tsr in the middle creates 'next' in the record.

It's not technically a pause as tsl will display the duration of the latest entry only, but if you aggregate it later it'll all sum up.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: