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

Support Microsoft apps #22

Merged
merged 1 commit into from
Sep 18, 2024
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
21 changes: 16 additions & 5 deletions electron/helpers/monitored-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@ export class MonitoredApp {
app?: AppData,
): HeartbeatData | null {
const entity = this.entity(windowInfo, app);
const category = app ? this.category(app) : null;
const language = app ? this.language(app) : null;
const project = this.project(windowInfo);
if (!entity) {
return null;
}
const category = this.category(app);
const language = this.language(app);
const project = this.project(windowInfo);
return {
entity,
category,
language,
project,
};
}
static category(app: AppData): Category | null {
static category(app?: AppData): Category | null {
if (!app) {
return null;
}

switch (app.id) {
case "arcbrowser":
case "brave":
Expand All @@ -42,12 +46,14 @@ export class MonitoredApp {
return "browsing";

case "imessage":
case "microsoft_outlook":
case "slack":
case "wecom":
return "communicating";

case "iterm2":
case "mac_terminal":
case "microsoft_excel":
case "windows_terminal":
case "powershell":
case "warp":
Expand All @@ -58,6 +64,7 @@ export class MonitoredApp {
case "tableplus":
return "debugging";

case "microsoft_word":
case "notes":
case "notion":
return "writing docs";
Expand All @@ -73,7 +80,11 @@ export class MonitoredApp {
return null;
}
}
static language(app: AppData) {
static language(app?: AppData) {
if (!app) {
return null;
}

switch (app.id) {
case "canva":
case "figma":
Expand Down
16 changes: 11 additions & 5 deletions electron/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type Category =
| "writing docs"
| "writing tests";

export type EntityType = "file" | "app";
export type EntityType = "file" | "app" | "url" | "domain";

export type MonitoredApp =
| "arcbrowser"
Expand All @@ -28,21 +28,27 @@ export type MonitoredApp =
| "firefox"
| "imessage"
| "iterm2"
| "powershell"
| "linear"
| "mac_terminal"
| "microsoft_access"
| "microsoft_edge"
| "microsoft_excel"
| "microsoft_outlook"
| "microsoft_onenote"
| "microsoft_powerpoint"
| "microsoft_word"
| "notes"
| "notion"
| "postman"
| "powershell"
| "safari"
| "safaripreview"
| "microsoft_edge"
| "slack"
| "tableplus"
| "mac_terminal"
| "windows_terminal"
| "warp"
| "wecom"
| "whatsapp"
| "windows_terminal"
| "xcode"
| "zoom";

Expand Down
48 changes: 48 additions & 0 deletions electron/watchers/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,54 @@ export const allApps: MonitoredAppInfo[] = [
},
isDefaultEnabled: true,
},
{
id: "microsoft_access",
windows: {
exePath: "MSACCESS.exe",
DisplayName: "Microsoft Access",
},
isDefaultEnabled: true,
},
{
id: "microsoft_excel",
windows: {
exePath: "EXCEL.exe",
DisplayName: "Microsoft Excel",
},
isDefaultEnabled: true,
},
{
id: "microsoft_onenote",
windows: {
exePath: "ONENOTE.exe",
DisplayName: "Microsoft OneNote",
},
isDefaultEnabled: true,
},
{
id: "microsoft_outlook",
windows: {
exePath: "OUTLOOK.exe",
DisplayName: "Microsoft Outlook",
},
isDefaultEnabled: true,
},
{
id: "microsoft_powerpoint",
windows: {
exePath: "POWERPNT.exe",
DisplayName: "Microsoft PowerPoint",
},
isDefaultEnabled: true,
},
{
id: "microsoft_word",
windows: {
exePath: "WINWORD.exe",
DisplayName: "Microsoft Word",
},
isDefaultEnabled: true,
},
{
id: "notes",
mac: {
Expand Down
Loading