Package: time-on-fire
time-on-fireA simple activity tracker written in Python for Windows 10.Why? There are time trackers already.I didn't find asimpletime tracker for Windows. A lot of them are for teams/are paid/have a lot of features that I didn't need (like tracking time spent on projects, graphs, analytics, goals, grouping activities and so forth). Most of the time I just needed to check what I was doing today, or to see the average screen time of my apps this week. For these simple tasks,time-on-fireis much better suited, allowing me to do them in a single keystroke:tof reportandtof report 2022-07-10:2022-07-16 -m avgrespectively. It's deliberately crude and simple, containing only 3 commands (only one of which takes an argument and an option). If you want a GUI and more advanced features, check outActivityWatch. It's crossplatform, free and open source.QuickstartInstallation рџ’ѕExecutepip install time-on-firein your terminal, and wait till pip finishes the installation. (orpy -m pip install tofif didn't work)Tracking рџ”ЋTo start tracking your activities, executetof track. Your activities (apps, foreground processes) are now being saved into a database.Hit Ctrl+C when you're done. Just don't forget to stop recording before you turn off your computer, as the last activity won't be saved!You can add a--debugflag when you execute thetrackcommand, to see the transitions between activities (e.g.1.exe 11:00 -> 2.exe 12:00)You can clear the database withtof clear_db.Creating reports рџ“ЉUse thereportcommand to create reports of your activities.Arguments:date_rangeA date inYYYY-MM-DDformat, or a range of dates inYYYY-MM-DD|YYYY-MM-DDformat.  Default is today.Options:--mode,-mOne of the three modes:total,avgandraw.total- Total screen time per process in range.avg- Average screen time per day per process in range.raw- Raw records (id, date, process name, start time, end time) in range.Default istotal.Examples:tof reportreturns a table summarizing your today activity;tof report 2022-05-05|2022-05-18 -m avgreturns a table, containing the average screen time of each process per day, from
5th to 18th of May;tof report 2022-04-01 -m rawreturns raw database records that were made on 1st of April.Config вљ™пёЏDo you have some app that pops up when idling and messes up your records (a reminder or an alarm, a floating dock, any process that's sometimes or always in the foreground, but you don't want to track its screen time)?Good news, you can configuretime-on-fireto ignore these processes!
How to find the config:Executepip show tof(orpy--m pip show tof) and look for a Location row. Go to this path.Insidesite-packagesfolder (where you just navigated) look for a folder named (or contains)time-on-fire, then navigate inside.There will be atime_on_firefolder (inside oftime-on-fire), inside of which you'll findconfig.py, our configuration file!
It looks like this (without comments):POLLING_DELAY=0.2IGNORE_PROCESSES=["ShellExperienceHost.exe","mbamtray.exe","ueli.exe","explorer.exe"]POLLING_DELAYis how fast the script polls for the current foreground process.IGNORE PROCESSESis a list of processes that the script will ignore.NotesIf, for example, you switch from Chrome to desktop, it will still count as Chrome's screen time, becauseexplorer.exedoes not only pop up at desktop, but also when clicking the taskbar or just idling. I have no reliable way of knowing whether the user switched to desktop or it's popping by itself (it could last from 3 seconds to 15 minutes during testing). Let me know if you have a fix.The innertime_on_firefolder is written with underscores, because it's a package, and Python packages shouldn't have an underscore. The outer folder is a repository (either on GitHub or PyPI).That's it. That's the documentation. It's that simple.