{"id":26960872,"url":"https://github.com/2e3s/awatcher","last_synced_at":"2026-03-02T08:08:12.142Z","repository":{"id":153935319,"uuid":"626659549","full_name":"2e3s/awatcher","owner":"2e3s","description":"Activity and idle watchers","archived":false,"fork":false,"pushed_at":"2025-02-17T21:24:34.000Z","size":495,"stargazers_count":163,"open_issues_count":17,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-17T22:27:08.456Z","etag":null,"topics":["productivity","self-tracking","time-tracker"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2e3s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-11T23:09:51.000Z","updated_at":"2025-02-17T21:24:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"4631e428-f4af-4d29-94e7-a8597bda32ad","html_url":"https://github.com/2e3s/awatcher","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2e3s%2Fawatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2e3s%2Fawatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2e3s%2Fawatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2e3s%2Fawatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2e3s","download_url":"https://codeload.github.com/2e3s/awatcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939202,"owners_count":20857919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["productivity","self-tracking","time-tracker"],"created_at":"2025-04-03T05:01:25.025Z","updated_at":"2026-03-02T08:08:04.240Z","avatar_url":"https://github.com/2e3s.png","language":"Rust","funding_links":[],"categories":["Window Watchers :desktop_computer:"],"sub_categories":[],"readme":"# Awatcher\n[![Check](https://github.com/2e3s/awatcher/actions/workflows/verify.yml/badge.svg)](https://github.com/2e3s/awatcher/actions/workflows/verify.yml)\n[![Dependency Status](https://deps.rs/repo/github/2e3s/awatcher/status.svg)](https://deps.rs/repo/github/2e3s/awatcher)\n\nAwatcher is a window activity and idle watcher with an optional tray and UI for statistics.\nThe goal is to compensate the fragmentation of desktop environments on Linux by supporting all reportable environments, \nto add more flexibility to reports with filters, and to have better UX with the distribution by a single executable.\n\nThe foundation is [ActivityWatch](https://github.com/ActivityWatch), which includes the provided server and web UI.\nThe unbundled watcher is supposed to replace the original idle and active window watchers from the original distribution.\nThe bundled executable can be used independently as it contains the server, UI and tray.\n\nThe binaries for the bundle, bundled DEB/RPM and ActivityWatch watchers replacement can be downloaded from\n[releases](https://github.com/2e3s/awatcher/releases).\nAt this moment, neither Flatpak nor AppImage support quering Wayland activity.\n\n### Module for ActivityWatch\n\n- Run `sudo unzip aw-awatcher.zip -d /usr/local/bin` in the console to allow ActivityWatch to detect its presence.\n  - Or install the provided **aw-awatcher_\\*.deb** or **aw-awatcher_\\*.rpm**.\n- Remove `aw-watcher-window` and `aw-watcher-afk` from autostart at `aw-qt/aw-qt.toml` in [config directory](https://docs.activitywatch.net/en/latest/directories.html#config),\n  add `aw-awatcher`.\n- Restart ActivityWatch. In the Modules submenu there should be a new checked module **aw-awatcher**. Note that awatcher shows up in the Web UI under Timeline as `aw-watcher-window_$HOSTNAME`.\n- Optionally, you can use systemd instead of ActivityWatch runner. In this case, skip adding `aw-awatcher` to `aw-qt.toml` and install this service [configuration](https://github.com/2e3s/awatcher/blob/main/config/aw-awatcher.service). In this case, ActivityWatch server also must be managed by systemd (as `aw-server.service` in the config).\n\n### Bundle with built-in ActivityWatch\n\nThis is a single binary to run **awatcher** with the server without changing system and ActivityWatch configuration.\nThe bundle is **aw-server-rust** and **awatcher** as a single executable.\nThe data storage is compatible with ActivityWatch and **aw-server-rust** (**aw-server** has a different storage), so this can later be run as a module for ActivityWatch.\n\nExternal modules are run like in the original ActivityWatch distribution\nby looking at `$PATH` and running all executables whose name starts with `aw-`.\nThey are controled from the tray, no additional configuration is necessary.\n\n#### Autostart\n\nIt is recommended to use `~/.config/autostart` for the bundle. This folder is employed by \"Autostart\" in KDE settings and Gnome Tweaks.\nSystemd may require to sleep for a few seconds (`ExecStartPre=/bin/sleep 5`) in order to wait for the environment.\nSee this service [configuration](https://github.com/2e3s/awatcher/blob/main/config/awatcher.service).\n\n## Supported environments\n\nActivityWatch server should be run before `awatcher` is running.\nAt this moment only Linux is supported. The watcher type is selected automatically\nas soon as the environment has the necessary interfaces.\n\n| Environment     | Active window        | Idle                |\n| --------------- | -------------------- | ------------------- |\n| X11             | :green_circle:       | :green_circle:      |\n| Sway, Hyprland  | :green_circle: [^1]  | :green_circle: [^2] |\n| Wayland + KDE   | :yellow_circle: [^3] | :green_circle:      |\n| Wayland + Gnome | :yellow_circle: [^4] | :green_circle:      |\n\n\u003e [!IMPORTANT]\n\u003e Gnome watcher in Wayland requires [this extension](https://extensions.gnome.org/extension/5592/focused-window-d-bus/) to be installed.\n\u003e Also, if you have problems with tray icons in Gnome, you may try [this extension](https://extensions.gnome.org/extension/615/appindicator-support/) for the bundle (StatusNotifierItem specification).\n\n[^1]: A few other DEs besides Sway may implement [wlr foreign toplevel protocol](https://wayland.app/protocols/wlr-foreign-toplevel-management-unstable-v1),\n[^2]: [KWin idle](https://wayland.app/protocols/kde-idle) and [Idle notify](https://wayland.app/protocols/ext-idle-notify-v1) protocols are supported.\n[^3]: KWin doesn't implement any toplevel protocol yet, KWin script is utilized instead (builtin, no actions required).\n      KDE partially supports XWayland, but inconsistently, hence X11 is not utilized for it.\n[^4]: Gnome doesn't implement any toplevel protocol yet, so [this extension](https://extensions.gnome.org/extension/5592/focused-window-d-bus/) should be installed.\n\n## Configuration\n\nThe config file is in the default directory (`~/.config/awatcher`).\n```toml\n[server]\nport = 5600\nhost = \"127.0.0.1\"\n\n[awatcher]\nidle-timeout-seconds=180\npoll-time-idle-seconds=4\npoll-time-window-seconds=1\n\n[[awatcher.filters]]\n# match only \"navigator\"\nmatch-app-id = \"navigator\"\n# match any title which contains \"Secret\" or \"secret\" \nmatch-title = \".*[sS]ecret.*\"\nreplace-app-id = \"firefox\"\nreplace-title = \"Unknown\"\n```\n\n- `server.port` and `server.host` address the ActivityWatch server instance.\n- `awatcher.idle-timeout-seconds` is the time of inactivity when it is considered \"idle\".\n- `awatcher.poll-time-idle-seconds` and `awatcher.poll-time-window-seconds` are \n  intervals between collecting and sending statistics.\n\nAll options of `server` and `awatcher` config file's sections can be overridden with command-line arguments, as well as the config path. See the builtin help in the command for details.\n\n### Filters\n\n`awatcher.filters` in the config file is an array of filters and replacements \nfor the cases when the application name or title should be hidden, or the app is reported incorrectly.\nCopy the section as many times as needed for every given filter.\n  - `match-app-id` matches the application name.\n  - `match-title` matches the title name.\n  - `replace-app-id` replaces the application name with the provided value.\n  - `replace-title` replaces the window title with the provided value.\n\nThe first matching filter stops the replacement.\nThere should be at least 1 match field for a filter to be valid.\nIf the replacement is not specified, the data is not reported when matched.\nMatches are case sensitive regular expressions between implicit ^ and $:\n- `.` matches 1 any character\n- `.*` matches any number of any characters\n- `.+` matches 1 or more any characters.\n- `word` is an exact match.\n- Use escapes `\\` to match special characters, e.g. `org\\.kde\\.Dolphin`\n\n#### Captures\n\nThe replacements in filters also support regexp captures.\nA capture takes a string in parentheses from the match and replaces `$N` in the replacement.\nExample to remove the changed file indicator in Visual Studio Code:\n- Before: \"● file_config.rs - awatcher - Visual Studio Code\"\n- After: \"file_config.rs - awatcher - Visual Studio Code\"\n```toml\n[[awatcher.filters]]\nmatch-app-id = \"code\"\nmatch-title = \"● (.*)\"\n# Inserts the content within 1st parentheses, this can be in any form, e.g. \"App $1 - $2/$3\"\nreplace-title = \"$1\"\n```\n\n#### Debugging app-id and title\n\nRun the command with \"debug\" or \"trace\" verbosity and without reporting to server in the terminal\nto see what application names and titles are reported to the server.\n```\n$ awatcher -vvv --no-server\n```\n\n## Build\n\n### Prerequisites\n\nNames of packages are from Ubuntu, other distributions may have different names.\n\n- Rust stable or nightly (for the bundle) toolchain\n- pkg-config\n- libssl-dev\n- libdbus-1-dev (for the bundled version)\n- build-essential\n\n### Compile\n\n- `cargo build --release` in the root of the repository.\n- The target file will be located at `target/release/awatcher`.\n\nAdd `--no-default-features` to the build command if you want to opt out of the Gnome and KDE support,\nadd `--features=?` (\"gnome\" or \"kwin_window\") on top of that if you want to enable just one.\n\nTo track your activities in browsers install the plugin for your browser from \n[here](https://github.com/ActivityWatch/aw-watcher-web) (Firefox, Chrome etc).\n\n#### Compile with bundle\n\nThe executable can be bundled with a tray icon, ActivityWatch server and, optionally, Web UI (if steps 1-2 are done):\n\n1. Clone and follow the instruction in [ActivityWatch/aw-webui@839366e](https://github.com/ActivityWatch/aw-webui/commit/839366e66f859faadd7f9128de3bea14b25ce4ae)\nto build the \"dist\" folder, \n1. Build the executable with `AW_WEBUI_DIR=/absolute/path/to/dist` and `--features=bundle`.\n\nThis should be compiled on nightly. The complete bundled version is also built and released.\n\nThe tray can be disabled with `--no-tray` option in the bundled version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2e3s%2Fawatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2e3s%2Fawatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2e3s%2Fawatcher/lists"}