It is easy to get lost doing the same thing for hours on your computer. Considering that being on the screen for long hours is not recommended. Spending long hours on unnecessary activities makes it even worse. Fortunately, there is a tool that makes it possible to monitor and track your activity on the computer.
ActivityWatch is an open-source program that makes it possible to track your activities and give you some insights into your usage patterns.
This article gives the steps on how to install and use ActivityWatch on your Linux machine to track your screen time.
ActivityWatch Installation
The first step to getting rid of the bad habits is to install ActivityWatch on your Linux System. This program is available for a wide range of Linux distributions, including Ubuntu, Fedora, and Arch Linux.
Unfortunately, ActivityWatch is not available in the official repositories of all Linux distributions, leaving us with the option to download the zip from the site.
-
Head to the ActivityWatch download page (https://activitywatch.net/downloads/) and find the Linux download options. Choose the zip file and let it download. You can also use the command below to download it from the command line.
wget https://github.com/ActivityWatch/activitywatch/releases/download/v0.12.1/activitywatch-v0.12.1-linux-x86_64.zip
-
Once the download is complete, open your terminal and navigate to where the download was saved. The save location will differ from computer to computer so use the
cd
command to change directories to the right folder. -
The next step is to unzip the download with the following command:
unzip activitywatch-v0.12.1-linux-x86_64.zip
Note: The version of ActivityWatch will vary, so make sure to unzip the one you downloaded.
If
unzip
is not installed on your system. Use the following command to install it.sudo apt install unzip
-
Once the file is unzipped, you should see a new folder named "activitywatch". Use the
ls
command to check the folders and files. -
Change the directory to that folder using the
cd
command and launch ActivityWatch with the following command../aw-qt
The server will start in the background, and you can access it from the system tray icon or on your browser via the URL "localhost:5600".
Data Collection
Now that ActivityWatch is running, it collects data about your screen time in the background.
To view the collected data, you can run the following command.
./aw-qt
This command launches the ActivityWatch Qt client, which provides a graphical interface for viewing and manipulating the collected data. So, you get to see your activities and the time spent on those activities. However, no useful data will be available if you install ActivityWatch for the first time. So, it would help if you let the program run in the background for a few hours before rechecking the dashboard.
Changing the Home Page
Every time you launch the ActivityWatch, you get the welcome page which shows information about the projects and Links to support the developers. For most people, the activity page is what is needed.
Change this behavior by going to the settings Tab at the window's top right corner. On the settings window, find the landing page and change to activity
in the dropdown menu.
Monitoring the Screen Activity
Several tabs are available on the ActivityWatch window. The Activity, Timeline, and Stopwatch Tabs are the ones to monitor more.
The Activity tab groups the data collected by applications, categories, and windows starting from the most used to the least. The longest bars show what you use more often. This data can be filtered with the date and time to give you precisely what you need.
You can also separate the data with the groups. I.e., window, Browser, Editor. The Editor shows the editors used and the browser displays the browser just as the name says.
The Timeline Tab shows a timeline of the entire history in a horizontal timeline. The timeline shows two categories: one is all your activity, and the other tracks the time you were away from your computer.
Exporting the Data Collected
You may need to export your data and use it for other projects or import it on another instance of ActivityWatch.
Head over to the Raw Data
section / Tab to export the data. A list of all the buckets is listed here. Click on the "more" dropdown menu on the bucket to export. Choose the format you want to export, and the data will be saved in your downloads folder
Conclusion
Tracking your screen time on Linux with ActivityWatch can help you gain insights into how you use your computer and identify areas where you may be wasting time. By setting up and configuring ActivityWatch, you can collect data on your screen time and use the ActivityWatch Qt client to view and manipulate the data. You can customize your data by creating buckets, moving events to them, and setting a watch for specific applications. Additionally, you can export your data for further analysis or record-keeping.
It is important to note that, tracking your screen time can help you become more aware of your habits and make positive changes, but It is not a substitute for self-reflection, self-awareness, and self-care. Taking regular breaks and prioritizing your physical and mental well-being while using your computer is important.