使用 ActivityWatch 跟踪你在 Linux 中的屏幕使用时间
时间
![](/data/attachment/album/202006/10/104854yumcnhp8smmjxcht.jpg)



> 
> ActivityWatch 是一款开源的隐私友好型应用程序，可追踪你在台式电脑或移动设备上的使用时间。
> 
> 
> 


### ActivityWatch: 一个追踪你在哪个应用程序上花了多少时间的开源应用程序


![](/data/attachment/album/202006/10/105009xuwamuwsem1jnouu.png)


[ActivityWatch](https://activitywatch.net/ "https://activitywatch.net/") 是一款跨平台的开源应用，可以帮助你追踪使用时间，衡量你的工作效率。它可以追踪你花在应用程序、浏览器上的时间，以及你是否 AFK（远离键盘）或系统处于休眠状态。


不只是追踪时间，它还提供了一堆有用的功能，通过可视化的方式帮助你轻松分析你是如何花费时间的，从而有可能提高你的生产力。


![](/data/attachment/album/202006/10/105028d4r3t1r66z658s8f.jpg)


它是 [RescueTime](https://itsfoss.com/recommends/rescuetime/ "https://itsfoss.com/recommends/rescuetime/") 和 [ManicTime](https://www.manictime.com/ "https://www.manictime.com/") 等专有产品的绝佳替代品。


ActivityWatch 可用于 Linux、Windows、macOS 和 [Android](https://play.google.com/store/apps/details?id=net.activitywatch.android "https://play.google.com/store/apps/details?id=net.activitywatch.android")。它还提供了 Chrome 和 Firefox 的浏览器扩展。截至目前，App Store 上还没有它的 iOS 版应用。


![](/data/attachment/album/202006/10/105107noniagjd8i9d1v9j.jpg)


它刚刚进入该领域，正在积极开发，以解决任何现有的问题并引入新的功能，如在多个设备上同步你的活动数据的能力。


**对于注重隐私的用户来说，我应该提到，收集的数据被存储在你本地的设备上。这是一件好事，因为你可以跟踪你的花费时间，而不会被别人跟踪。**


### ActivityWatch 的功能


![](/data/attachment/album/202006/10/105124t45jsz4zirsiqhxp.jpg)


基本上，ActivityWatch 可以让你监控你的活动，以分析不良的屏幕使用时间，或改善你在设备上工作的时间管理。


具体来说，它提供了几个有用的功能，主要有：


* 摘要你的日常活动及按使用时间排序的应用和程序列表。
* 追踪你的浏览器活动的时间，使用浏览器扩展来获得每个活动标签所花费时间的确切数据。
* 追踪 AFK 和非 AFK 时间。（AFK - “Away From Keyboard” 的缩写，即不在电脑前）
* 提供不同的可视化时间线，以监测你的活动。
* 能够使用 [watchers](https://docs.activitywatch.net/en/latest/watchers.html "https://docs.activitywatch.net/en/latest/watchers.html") 跟踪你在编辑器上写代码的时间。
* 记录你的活动，以分析你的生产力。
* 将花费的时间进行分类，可以帮助你详细分析。
* 可以添加更多的类别和调整时间轴的持续时长。
* 能够将数据导出/导入为 [JSON](https://en.wikipedia.org/wiki/JSON "https://en.wikipedia.org/wiki/JSON") 文件。
* 实验性的秒表功能。
* 本地存储数据，以尊重用户隐私。


### 在 Linux 上安装 ActivityWatch



> 
> 注：如果你的 Linux 发行版不支持系统托盘图标，你需要遵循这个[文档](https://docs.activitywatch.net/en/latest/getting-started.html "https://docs.activitywatch.net/en/latest/getting-started.html")来解决这个问题。
> 
> 
> 


不幸的是，你找不到 AppImage、Flatpak 或 Snap 软件包。然而，对于 Manjaro 或 Arch Linux 有可以安装的 [AUR](https://aur.archlinux.org/packages/activitywatch-bin/ "https://aur.archlinux.org/packages/activitywatch-bin/") 包。


对于所有其它的 Linux 发行版，你会得到一个 ZIP 文件，其中包括一个要运行的 `aw-qt` 应用程序。


要运行它，你需要[解压 zip 归档文件](https://itsfoss.com/unzip-linux/ "https://itsfoss.com/unzip-linux/")，然后通过双击 `aw-qt` 应用程序运行二进制文件来安装它。


![](/data/attachment/album/202006/10/105144y311e803pnq3cqau.jpg)


你也可以使用终端：



```
`cd activitywatch-v0.9.2-linux-x86_64
sudo ./aw-qt`
```

解压文件夹的位置和文件名可能会有所不同 —— 所以请确保你导航到正确的目录，然后使用上面的命令。完成后，你可以从系统托盘图标访问 ActivityWatch，或者直接前往 [localhost:5600](https://itsfoss.com/activitywatch/5600 "https://itsfoss.com/activitywatch/5600") 访问它。


你也可以查看他们的 [GitHub 页面](https://github.com/ActivityWatch "https://github.com/ActivityWatch")或[官方网站](https://activitywatch.net/ "https://activitywatch.net/")来探索更多关于它的信息。


* [下载 ActivityWatch](https://activitywatch.net/ "https://activitywatch.net/")


顺便提一句，如果你计划经常使用 ActivityWatch，你应该将下载的文件移动到 `/opt` 目录下，并在 `/usr/share/bin` 目录下创建一个链接到 `aw-qt` 可执行文件符号链接。这样一来，该应用程序可以作为一个常规命令供系统上的所有用户使用。类似的方法在 [PopcornTime 安装教程](https://itsfoss.com/popcorn-time-ubuntu-linux/ "https://itsfoss.com/popcorn-time-ubuntu-linux/")中也有演示。


### 我对 ActivityWatch 的看法


![](/data/attachment/album/202006/10/105206it9gjtpcngcj9kci.jpg)


在 [Pop!\_OS 20.04](https://itsfoss.com/pop-os-20-04-review/ "https://itsfoss.com/pop-os-20-04-review/") 上，时间跟踪功能可以完全正常地工作，也支持系统托盘图标。你可能会遇到一个错误，不能让你从系统托盘图标访问 ActivityWatch（这也是一个 [GitHub 上的已知问题](https://github.com/ActivityWatch/activitywatch/issues/208 "https://github.com/ActivityWatch/activitywatch/issues/208")）。在这种情况下，你需要通过 [localhost:5600](https://itsfoss.com/activitywatch/5600 "https://itsfoss.com/activitywatch/5600") 来访问它。


就个人而言，考虑到我在桌面上使用它，并且没有计划在智能手机上使用它，我对提供的功能相当满意。


我必须得向你推荐尝试这个不错的开源项目，并一路支持他们。如果你喜欢这个项目，请随时通过添加星标或赞助[他们的 GitHub 仓库](https://github.com/ActivityWatch/activitywatch "https://github.com/ActivityWatch/activitywatch")来表示你的赞赏。


欢迎在下面的评论中告诉我你的想法。




---


via: [https://itsfoss.com/activitywatch/](https://itsfoss.com/activitywatch/ "https://itsfoss.com/activitywatch/")


作者：[Ankush Das](https://itsfoss.com/author/ankush/ "https://itsfoss.com/author/ankush/") 选题：[lujun9972](https://github.com/lujun9972 "https://github.com/lujun9972") 译者：[wxy](https://github.com/wxy "https://github.com/wxy") 校对：[wxy](https://github.com/wxy "https://github.com/wxy")


本文由 [LCTT](https://github.com/LCTT/TranslateProject "https://github.com/LCTT/TranslateProject") 原创编译，[Linux中国](https://linux.cn/ "https://linux.cn/") 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

[ActivityWatch](https://activitywatch.net/?ref=itsfoss.com) is a cross-platform open-source app that helps you track time to gauge your productivity. It lets you track the time you spent on applications, browsers, and if you were AFK (away from keyboard) or the system was hibernating. Sort of like [Traqq](https://traqq.com/) but for personal usage.

![Activitywatch](https://itsfoss.com/content/images/2023/10/activitywatch.png)

Not just limited to tracking time, but it offers a bunch of useful features with visualizations that help you easily analyze how you spent time to potentially improve your productivity.

![Activitywatch Afk](https://itsfoss.com/content/images/wordpress/2020/05/activitywatch-afk.jpg)

It’s a great alternative to proprietary options like [RescueTime](https://itsfoss.com/recommends/rescuetime/) and [ManicTime](https://www.manictime.com/?ref=itsfoss.com).

ActivityWatch is available for Linux, Windows, macOS and [Android](https://play.google.com/store/apps/details?id=net.activitywatch.android&ref=itsfoss.com). It also offers browser extensions for both Chrome and Firefox. As of now, there’s no app available for iOS on the App Store.

![Activitywatch Timeline](https://itsfoss.com/content/images/wordpress/2020/05/activitywatch-timeline.jpg)

It’s fairly new to the scene and is being actively developed to address any existing issues and introduce new features like the ability to sync your activity data across multiple devices.

*For privacy-focused users, I should mention that the data collected is stored locally on your device. That’s a good thing as you can track your spent time without being tracked by someone else.*

## Features of ActivityWatch

![Activitywatch Settings](https://itsfoss.com/content/images/wordpress/2020/05/activitywatch-settings.jpg)

Basically, ActivityWatch lets you monitor your activity to analyze bad screen time or improve the time management for what you do on your device.

To break it down, it offers several useful options that I’d like to highlight here:

- Summary of your daily activity with apps/programs sorted as per the time spent using it.
- Track the time of your browser activity using the extension to get the exact data on time spent on every active tab.
- Tracks AFK and not-AFK time. (AFK — abbreviation for “Away From Keyboard” i.e. you’re not in front of your computer)
- Offers different visualizations of timelines to monitor your activity
- Ability to track the time you spend writing code on an editor using
[watchers](https://docs.activitywatch.net/en/latest/watchers.html?ref=itsfoss.com). - History of your activity to analyze your productivity
- Categorize the time spent to help you analyze in detail
- Lets you add more categories and tweak the duration of timeline.
- Ability to export/import your data as
[JSON](https://en.wikipedia.org/wiki/JSON?ref=itsfoss.com)file. - Experimental stopwatch feature
- Stores data locally to respect user privacy.

## Installing ActivityWatch on Linux

*Note:**If your Linux distribution does not support system tray icons, you will have to follow the* *documentation**for a workaround.*

Unfortunately, you won’t find an AppImage, Flatpak or Snap for it.

However, you do get an [AUR](https://aur.archlinux.org/packages/activitywatch-bin/?ref=itsfoss.com) package to install for Manjaro or Arch Linux.

For all other Linux distributions, you get a ZIP file which includes an **aw-qt** application to run.

To do that, you have to [extract the zip archive file](https://itsfoss.com/unzip-linux/) and then run the binary to install it by double-clicking on the aw-qt application.

![Aw Qt](https://itsfoss.com/content/images/wordpress/2020/05/aw-qt.jpg)

You can also use the terminal as follows:

```
cd activitywatch-v0.9.2-linux-x86_64/activitywatch
./aw-qt
```


The location and filename of the extracted folder might differ – so make sure you navigate to the correct directory and then use the commands above. Once done, you can access ActivityWatch from the system tray icon or simply head to [localhost:5600](https://itsfoss.com/activitywatch/5600) to access it.

You can also check out their [GitHub page](https://github.com/ActivityWatch?ref=itsfoss.com) or the [official website](https://activitywatch.net/?ref=itsfoss.com) to explore more about it.

Just for your information, if you plan on using ActivityWatch regularly, you should move the downloaded files to the /opt directory and create a link to aw-qt executable in /usr/share/bin directory. This way, the application will be available as a regular command for all the users on the system. A similar method has been demonstrated in the [PopcornTime installation tutorial](https://itsfoss.com/popcorn-time-ubuntu-linux/).

## My Thoughts On ActivityWatch

![Activitywatch Screenshot](https://itsfoss.com/content/images/wordpress/2020/05/activitywatch-screenshot.jpg)

The time tracking works perfectly fine on [Pop!_OS 20.04](https://itsfoss.com/pop-os-20-04-review/) with the system tray icon support. You might encounter a bug that doesn’t let you access ActivityWatch from your system tray icon (which is also a [known issue on GitHub](https://github.com/ActivityWatch/activitywatch/issues/208?ref=itsfoss.com)). In that case, you need to access it through [localhost:5600](https://itsfoss.com/activitywatch/5600).

Personally, I’m quite satisfied with the features offered considering that I use it on my desktop and have no plans to use it on my smartphone.

I’d definitely recommend you try this nice open-source project and support them along the way. If you like the project, feel free to show your appreciation by adding a star or sponsoring [their GitHub repository](https://github.com/ActivityWatch/activitywatch?ref=itsfoss.com).

Feel free to let me know your thoughts in the comments below.