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 GitHub Desktop Client #268

Merged
merged 1 commit into from
May 17, 2024
Merged
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
7 changes: 7 additions & 0 deletions WakaTime/Watchers/MonitoredApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum MonitoredApp: String, CaseIterable {
case chrome = "com.google.Chrome"
case figma = "com.figma.Desktop"
case firefox = "org.mozilla.firefox"
case github = "com.github.GitHubClient"
case imessage = "com.apple.MobileSMS"
case iterm2 = "com.googlecode.iterm2"
case linear = "com.linear"
Expand Down Expand Up @@ -56,6 +57,7 @@ enum MonitoredApp: String, CaseIterable {
static let defaultEnabledApps = [
MonitoredApp.canva.rawValue,
MonitoredApp.figma.rawValue,
MonitoredApp.github.rawValue,
MonitoredApp.linear.rawValue,
MonitoredApp.notes.rawValue,
MonitoredApp.notion.rawValue,
Expand All @@ -82,6 +84,8 @@ enum MonitoredApp: String, CaseIterable {
return .designing
case .firefox:
return .browsing
case .github:
return .codereviewing
case .imessage:
return .communicating
case .iterm2:
Expand Down Expand Up @@ -118,6 +122,7 @@ enum MonitoredApp: String, CaseIterable {
}

func project(for element: AXUIElement) -> String? {
// TODO: detect repo from GitHub Desktop Client if possible
guard let url = currentBrowserUrl(for: element) else { return nil }
return project(from: url)
}
Expand Down Expand Up @@ -258,6 +263,8 @@ enum MonitoredApp: String, CaseIterable {
return title
case .firefox:
fatalError("\(self.rawValue) should never use window title as entity")
case .github:
return element.extractPrefix(element.rawTitle, separator: " - ")
case .imessage:
return element.extractPrefix(element.rawTitle, separator: " - ")
case .iterm2:
Expand Down
Loading