Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect modules #11

Merged
merged 5 commits into from
May 20, 2024
Merged

Detect modules #11

merged 5 commits into from
May 20, 2024

Conversation

0xbrayo
Copy link
Member

@0xbrayo 0xbrayo commented May 16, 2024

Fixes #12


🚀 This description was created by Ellipsis for commit 28a093e

Summary:

This PR enhances module detection by adding functionality to identify and manage 'aw' prefixed executables in the system PATH, and consolidates tauri imports for cleaner code.

Key points:

  • Consolidated tauri imports in src-tauri/src/main.rs.
  • Added get_modules_in_path function in src-tauri/src/manager.rs to detect 'aw' prefixed executables in PATH.
  • Populated modules_in_path in ManagerState to track and manage executable modules found in system PATH.
  • Updated system tray menu creation to include options for starting modules found in PATH but not currently running.

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to addd234 in 48 seconds

More details
  • Looked at 99 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src-tauri/src/manager.rs:73
  • Draft comment:
    The removal of 'awk' from the set of detected executables is a specific handling for Unix systems to avoid false positives. Consider documenting this behavior in the function's comments to clarify the intent for future maintainers.
  • Reason this comment was not posted:
    Confidence changes required: 33%
    The function get_watchers_in_path in both Unix and Windows configurations is designed to detect executables starting with 'aw' in the PATH directories. However, the function removes 'awk' from the set of detected executables, which is specific to Unix systems. This is done to avoid false positives as 'awk' is a common Unix utility but not related to the intended 'aw' modules. The function uses a HashSet to ensure uniqueness and then converts it to a Vec. The use of metadata and permissions checks ensures that only executable files are considered.

Workflow ID: wflow_6KiFPNVEgQA3UU7J


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

3 days left in your free trial, upgrade for $20/seat/month or contact us.

@0xbrayo 0xbrayo closed this May 16, 2024
@0xbrayo 0xbrayo reopened this May 16, 2024
@0xbrayo 0xbrayo marked this pull request as draft May 16, 2024 19:45
@0xbrayo 0xbrayo marked this pull request as ready for review May 17, 2024 14:33
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 28a093e in 2 minutes and 25 seconds

More details
  • Looked at 171 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src-tauri/src/manager.rs:174
  • Draft comment:
    The function send_sigterm has redundant return statements. Consider removing the unnecessary Ok(()) at the end of the function.
    }
}
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_o3B52dDJoG0JfN8S


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

3 days left in your free trial, upgrade for $20/seat/month or contact us.

@0xbrayo
Copy link
Member Author

0xbrayo commented May 17, 2024

Link the related issue too, I can't. I don't have the necessary permissions I guess

@ErikBjare
Copy link
Member

@brayo-pip Just mention it in the issue description, like so: "Closes #issue_number"

@0xbrayo
Copy link
Member Author

0xbrayo commented May 17, 2024

I don't have the gear icons here
image

src-tauri/src/manager.rs Show resolved Hide resolved
src-tauri/src/manager.rs Show resolved Hide resolved
src-tauri/src/manager.rs Show resolved Hide resolved
@ErikBjare
Copy link
Member

@brayo-pip I meant like this:

image

@ErikBjare
Copy link
Member

Very nice! Since you structured your commits and the messages so well, I'll go ahead and skip squash and rebase-merge it :)

@ErikBjare ErikBjare merged commit 1bb120d into ActivityWatch:master May 20, 2024
5 checks passed
Comment on lines -166 to +180
let autostart_modules = ["aw-module-afk", "aw-module-window"];
let autostart_modules = ["aw-watcher-afk", "aw-watcher-window"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oopsie, sorry about this.

@0xbrayo 0xbrayo deleted the detect-modules branch November 13, 2024 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

system tray should list modules in alphabetical order
2 participants