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

Release v3.9.0 #178

Merged
merged 6 commits into from
Nov 29, 2023
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
39 changes: 37 additions & 2 deletions WakaTime/Extensions/AXUIElementExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,52 @@ extension AXUIElement {
title != "Postman"
else { return nil }

return title
case .warp:
guard
let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true),
title != "Warp"
else { return nil }
return title
case .slack:
guard let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true) else { return nil }
return title
case .safari:
guard
let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true),
title != "Safari"
else { return nil }
return title
case .imessage:
guard let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true) else { return nil }
return title
case .canva:
guard
let title = extractPrefix(rawTitle, separator: " - ", minCount: 2),
title != "Canva",
title != "Home"
else { return nil }

return title
case .xcode:
return nil
fatalError("Xcode should never use window title as entity")
case .chrome:
guard
let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true),
title != "Chrome"
else { return nil }
return title
case .arcbrowser:
guard
let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true),
title != "Arc"
else { return nil }
return title
case .whatsapp:
guard let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true) else { return nil }
return title
case .zoom:
guard let title = extractPrefix(rawTitle, separator: " - ", fullTitle: true) else { return nil }
return title
}
}

Expand Down
18 changes: 15 additions & 3 deletions WakaTime/Extensions/NSRunningApplicationExtension.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import Cocoa

enum MonitoredApp: String, CaseIterable {
case xcode = "com.apple.dt.Xcode"
case figma = "com.figma.Desktop"
case arcbrowser = "company.thebrowser.Browser"
case canva = "com.canva.CanvaDesktop"
case chrome = "com.google.Chrome"
case figma = "com.figma.Desktop"
case imessage = "com.apple.MobileSMS"
case postman = "com.postmanlabs.mac"
case safari = "com.apple.Safari"
case slack = "com.tinyspeck.slackmacgap"
case warp = "dev.warp.Warp-Stable"
case whatsapp = "net.whatsapp.WhatsApp"
case xcode = "com.apple.dt.Xcode"
case zoom = "us.zoom.xos"

init?(from bundleId: String) {
if let app = MonitoredApp(rawValue: bundleId) {
Expand All @@ -18,7 +26,11 @@ enum MonitoredApp: String, CaseIterable {
MonitoredApp.allCases.map { $0.rawValue }
}

static let electronAppIds = [MonitoredApp.postman.rawValue, MonitoredApp.figma.rawValue, MonitoredApp.canva.rawValue]
static let electronAppIds = [MonitoredApp.postman.rawValue, MonitoredApp.figma.rawValue,
MonitoredApp.canva.rawValue, MonitoredApp.warp.rawValue,
MonitoredApp.slack.rawValue, MonitoredApp.safari.rawValue,
MonitoredApp.imessage.rawValue, MonitoredApp.chrome.rawValue,
MonitoredApp.arcbrowser.rawValue]
}

extension NSRunningApplication {
Expand Down
32 changes: 32 additions & 0 deletions WakaTime/Helpers/MonitoringManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,43 @@ class MonitoringManager {
entity: title,
language: "HTTP Request",
category: .debugging)
case .warp:
return HeartbeatData(
entity: title,
category: .coding)
case .slack:
return HeartbeatData(
entity: title,
category: .communicating)
case .safari:
return HeartbeatData(
entity: title,
category: .browsing)
case .chrome:
return HeartbeatData(
entity: title,
category: .browsing)
case .arcbrowser:
return HeartbeatData(
entity: title,
category: .browsing)
case .imessage:
return HeartbeatData(
entity: title,
category: .communicating)
case .canva:
return HeartbeatData(
entity: title,
language: "Canva Design",
category: .designing)
case .whatsapp:
return HeartbeatData(
entity: title,
category: .meeting)
case .zoom:
return HeartbeatData(
entity: title,
category: .meeting)
case .xcode:
fatalError("Xcode should never use window title")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,68 @@
{"images":[{"size":"128x128","expected-size":"128","filename":"128.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"256x256","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"128x128","expected-size":"256","filename":"256.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"256x256","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"512x512","expected-size":"512","filename":"512.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"16","filename":"16.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"1x"},{"size":"16x16","expected-size":"32","filename":"32.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"32x32","expected-size":"64","filename":"64.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"},{"size":"512x512","expected-size":"1024","filename":"1024.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"mac","scale":"2x"}]}
{
"images" : [
{
"filename" : "16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "32.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "32.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "64.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "256.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "256.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "512.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "512.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "1024.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
5 changes: 4 additions & 1 deletion WakaTime/WakaTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,13 @@ enum EntityType: String {
}

enum Category: String {
case coding
case browsing
case building
case coding
case communicating
case debugging
case designing
case meeting
}

protocol StatusBarDelegate: AnyObject {
Expand Down
Loading