Directories¶
Where things get stored depends on the platform you’re using. All paths should follow standard directories on their platforms, and to accomplish this we use platformdirs in Python code and the dirs crate in Rust code.
Each ActivityWatch component stores its data in a subdirectory named after itself.
The paths below use aw-server-rust as an example component.
Note
On Windows, Python components (aw-server, aw-qt, aw-watcher-afk, aw-watcher-window, …) use one extra activitywatch level, e.g. C:\Users\<USER>\AppData\Local\activitywatch\activitywatch\aw-server for data and ...\Local\activitywatch\activitywatch\Logs\aw-watcher-window for logs. Rust components (aw-server-rust, aw-sync) use the paths listed below; aw-tauri follows them for its own config and data from the release after v0.14.0 (aw-tauri#280).
Note
v0.14.0 on Windows mistakenly stored aw-server-rust data and config, and aw-sync config, under AppData\Roaming (%APPDATA%) instead of AppData\Local (%LOCALAPPDATA%). The release after v0.14.0 fixes this and migrates automatically on startup:
If
AppData\Local\activitywatch\aw-server-rusthas no database yet, theRoamingfolder is copied there, verified, and the original kept asaw-server-rust.migrated-<date>. Nothing is deleted or overwritten. If a Pythonaw-serverdatabase exists,aw-server-rustalso runs the import of it thatv0.14.0skipped, once.If
AppData\Localalready has a database (you used ActivityWatch beforev0.14.0), it stays in use and theRoamingfolder is left untouched, with a warning in the log. Events recorded while runningv0.14.0are in thatRoamingdatabase and are not merged automatically.If the copy cannot be completed safely, the
Roamingfolder keeps being used and the migration is retried on the next start.
Note
These paths are pinned by tests on every platform: tests/test_dirs_pinned.py in aw-core (Python), test_default_paths_are_pinned in aw-server-rust (and aw-tauri once #280 lands), and test_legacy_dbfile_path_is_pinned in aw-server-rust (where the Python database is looked for when migrating). If you change a path, change this page and those tests together, and add a migration for existing installs.
Data¶
This is where the SQLite database and other persistent data is stored.
Windows:
C:\Users\<USER>\AppData\Local\activitywatch\aw-server-rustmacOS:
~/Library/Application Support/activitywatch/aw-server-rustLinux:
~/.local/share/activitywatch/aw-server-rust
Config¶
Configuration files for each component.
Windows:
C:\Users\<USER>\AppData\Local\activitywatch\aw-server-rustmacOS:
~/Library/Application Support/activitywatch/aw-server-rustLinux:
~/.config/activitywatch/aw-server-rust, or the path defined by the$XDG_CONFIG_HOMEenvironment variable.
Other components have their own config directories, e.g. aw-watcher-afk, aw-watcher-window.
Logs¶
Windows:
C:\Users\<USER>\AppData\Local\activitywatch\Logs\aw-server-rustmacOS:
~/Library/Logs/activitywatch/aw-server-rustLinux:
~/.cache/activitywatch/log/aw-server-rust
Cache¶
Windows:
C:\Users\<USER>\AppData\Local\activitywatch\Cache\aw-server-rustmacOS:
~/Library/Caches/activitywatch/aw-server-rustLinux:
~/.cache/activitywatch/aw-server-rust
Profiles¶
Starting with v0.14, you can run named profiles. A profile is an isolated ActivityWatch instance with its own data, config, and logs, which can run at the same time as your normal instance. The default profile is the normal install, and testing is the profile used by the --testing flag (which runs on port 5666).
To start a profile, run aw-qt --profile <name>. aw-qt passes the profile on to the modules it starts through the AW_PROFILE environment variable. When starting modules separately, set AW_PROFILE=<name> for each of them; aw-server, aw-server-rust, and aw-sync also accept --profile <name>.
For a profile other than default, every directory above uses activitywatch-<name> in place of activitywatch. For example, the Linux data directory for a profile named research is ~/.local/share/activitywatch-research/aw-server-rust.
Profile names must be lowercase letters, digits, - or _ (starting with a letter or digit), and at most 32 characters.
Note
A named profile uses port 5600 unless configured otherwise, which collides with your default instance. Set a different port in that profile’s server and aw-client config files (see Configuration) before running both at once.