Here's the guide to installing ActivityWatch from source. If you are just looking to try it out, see the getting started guide instead.
Note
This is written for Linux and macOS. For Windows the build process is more complicated and we therefore suggest using the pre-built packages instead on that operating system (but if you really have to, see :doc:`this guide <installing-from-source-on-windows>`).
Since the ActivityWatch bundlerepo uses submodules, you first need to clone the submodules.
This can either be done at the cloning stage with:
git clone --recursive https://github.com/ActivityWatch/activitywatch.gitOr afterwards (if you've already cloned normally) using:
git submodule update --init --recursiveYou need:
- Python 3.6 or later, check with
python3 -V(required to build the core components) - Node 8 or higher, check with
node -vandnpm -v(required to build the web UI)
Note
If you don't want to use a virtualenv you could instead set the environment variable PIP_USER=true when building in the next step.
But make sure that the folder ~/.local/bin (on Linux) or ~/Library/Python/<version>/bin (on macOS) is in your PATH.
It is recommended to use a virtualenv in order to avoid polluting your system with ActivityWatch-specific Python packages. It also makes it easier to uninstall since all you have to do is remove the virtualenv folder.
python3 -m venv venvNow activate the virtualenv in your current shell session:
# For bash/zsh users:
source ./venv/bin/activate
# For Windows git bash users:
source ./venv/Scripts/activate
# For fish users:
source ./venv/bin/activate.fishBuild and install everything into the virtualenv:
make buildNote
If you're building from source to develop we suggest building/installing using make build DEV=true which installs all Python packages with pip's handy --editable flag.
By doing this you wont have to reinstall everything whenever you want to try out a code change.
Now you should be able to start ActivityWatch from the terminal where you've activated the virtualenv. Or, if you were using the PIP_USER trick, from any terminal with a correctly configured PATH.
You have two options:
- Use the trayicon manager (Recommended for normal use)
- Run from your terminal with:
aw-qt
- Run from your terminal with:
- Start each module separately (Recommended for developing)
- Run from your terminal with:
aw-server,aw-watcher-afk, andaw-watcher-window
- Run from your terminal with:
Both methods take the --testing flag as a command line parameter to run in testing mode. This runs the server on a different port (5666) and uses a separate database file to avoid mixing your important data with your testing data.
Now everything should be running! Check out the web UI at http://localhost:5600/
If anything doesn't work, let us know!
Note
On Linux, if you want to run from source using a .desktop file launcher, see :issue:`176`.
First pull the latest version of the repo with git pull then get the updated submodules with git submodule update --init --recursive. All that's needed then is a make build.
If it doesn't work, you can first try to run make uninstall and then do a fresh make build. If that fails as well, remove the virtualenv and start over.
Please report all issues you might have so we can make things easier for future users.
If you made some changes and want to create a proper build with portable executables (like normal ActivityWatch releases) you need to install pyinstaller (and on Debian-like distros python3-dev).
apt install python3-dev # Or equivalent for your Linux distribution
pip3 install --user pyinstallerThen simply run the following to package it:
make packageWhen the packaging is done you will have ./dist folder where you can find a zipped version and an unzipped activitywatch folder, you can move or copy that folder anywhere you need and set aw-qt to run from startup.