Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
[submodule "aw-server-rust"]
path = aw-server-rust
url = https://github.com/ActivityWatch/aw-server-rust.git
[submodule "aw-notify"]
path = aw-notify
url = https://github.com/ErikBjare/aw-notify.git
[submodule "aw-watcher-input"]
path = aw-watcher-input
url = https://github.com/ActivityWatch/aw-watcher-input.git
Expand All @@ -31,3 +28,6 @@
[submodule "awatcher"]
path = awatcher
url = https://github.com/2e3s/awatcher
[submodule "aw-notify"]
path = aw-notify
url = https://github.com/ActivityWatch/aw-notify-rs.git
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ For a complete list of the things ActivityWatch can track, [see the page on *wat
```mermaid
graph TD;
aw-qt[<a href='https://github.com/ActivityWatch/aw-qt'>aw-qt</a>];
aw-notify[<a href='https://github.com/ActivityWatch/aw-notify'>aw-notify</a>];
aw-notify[<a href='https://github.com/ActivityWatch/aw-notify-rs'>aw-notify</a>];
aw-server[<a href='https://github.com/ActivityWatch/aw-server'>aw-server</a>];
aw-webui[<a href='https://github.com/ActivityWatch/aw-webui'>aw-webui</a>];
aw-watcher-window[<a href='https://github.com/ActivityWatch/aw-watcher-window'>aw-watcher-window</a>];
Expand Down
2 changes: 1 addition & 1 deletion aw-notify
32 changes: 25 additions & 7 deletions aw.spec
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,33 @@ aw_watcher_window_a = build_analysis(
(aww_location / "aw_watcher_window/printAppStatus.jxa", "aw_watcher_window")
],
)
aw_notify_a = build_analysis(
# Check if aw-notify is a Python package
_notify_candidates = [
aw_notify_location / "aw_notify/__main__.py",
aw_notify_location / "src/aw_notify/__main__.py",
]
skip_aw_notify = not any(p.exists() for p in _notify_candidates)
if skip_aw_notify:
print("Skipping aw-notify Python packaging (Rust-based implementation detected)")

aw_notify_a = None if skip_aw_notify else build_analysis(
"aw_notify", aw_notify_location, hiddenimports=["desktop_notifier.resources"]
)

# https://pythonhosted.org/PyInstaller/spec-files.html#multipackage-bundles
# MERGE takes a bit weird arguments, it wants tuples which consists of
# the analysis paired with the script name and the bin name
MERGE(
merge_args = [
(aw_server_a, "aw-server", "aw-server"),
(aw_qt_a, "aw-qt", "aw-qt"),
(aw_watcher_afk_a, "aw-watcher-afk", "aw-watcher-afk"),
(aw_watcher_window_a, "aw-watcher-window", "aw-watcher-window"),
(aw_watcher_input_a, "aw-watcher-input", "aw-watcher-input"),
(aw_notify_a, "aw-notify", "aw-notify"),
)
]
if aw_notify_a is not None:
merge_args.append((aw_notify_a, "aw-notify", "aw-notify"))

MERGE(*merge_args)


# aw-server
Expand All @@ -201,16 +213,22 @@ awq_coll = build_collect(
# aw-watcher-input
awi_coll = build_collect(aw_watcher_input_a, "aw-watcher-input")

aw_notify_coll = build_collect(aw_notify_a, "aw-notify")
# aw-notify (only if Python package exists)
aw_notify_coll = build_collect(aw_notify_a, "aw-notify") if aw_notify_a is not None else None

if platform.system() == "Darwin":
app = BUNDLE(
bundle_args = [
awq_coll,
aws_coll,
aww_coll,
awa_coll,
awi_coll,
aw_notify_coll,
]
if aw_notify_coll is not None:
bundle_args.append(aw_notify_coll)

app = BUNDLE(
*bundle_args,
name="ActivityWatch.app",
icon=icon,
bundle_identifier="net.activitywatch.ActivityWatch",
Expand Down
Loading