diff --git a/dist/Available.app/Contents/Info.plist b/dist/Available.app/Contents/Info.plist index 687e37a..b1e536c 100644 --- a/dist/Available.app/Contents/Info.plist +++ b/dist/Available.app/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22E252 + 22E261 CFBundleDevelopmentRegion en CFBundleDisplayName @@ -23,7 +23,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.4.6 + 1.4.7 CFBundleSupportedPlatforms MacOSX diff --git a/dist/Available.app/Contents/MacOS/Available b/dist/Available.app/Contents/MacOS/Available index 166dada..d435c37 100755 Binary files a/dist/Available.app/Contents/MacOS/Available and b/dist/Available.app/Contents/MacOS/Available differ diff --git a/dist/Available.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib b/dist/Available.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib index ad25fd7..aeeb8b7 100644 Binary files a/dist/Available.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib and b/dist/Available.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib differ diff --git a/dist/Available.app/Contents/Resources/available-cli b/dist/Available.app/Contents/Resources/available-cli index c14f218..5b8c061 100755 Binary files a/dist/Available.app/Contents/Resources/available-cli and b/dist/Available.app/Contents/Resources/available-cli differ diff --git a/dist/Available.app/Contents/Resources/output-cli b/dist/Available.app/Contents/Resources/output-cli index 2bbace0..802e9d8 100755 Binary files a/dist/Available.app/Contents/Resources/output-cli and b/dist/Available.app/Contents/Resources/output-cli differ diff --git a/dist/Available.app/Contents/_CodeSignature/CodeResources b/dist/Available.app/Contents/_CodeSignature/CodeResources index 20d0f0b..17f1bde 100644 --- a/dist/Available.app/Contents/_CodeSignature/CodeResources +++ b/dist/Available.app/Contents/_CodeSignature/CodeResources @@ -18,15 +18,15 @@ Resources/Base.lproj/Main.storyboardc/MainMenu.nib - duhx0JUtdOeQ+XkStIgAKCZYVgw= + NB8gl+eVnWQculmbS6znhZJqteE= Resources/available-cli - Cr1BNtjDDl+iEXSihTy337pdLuI= + RyRUvHndZQz4UlDynyZAkN6q7dM= Resources/output-cli - czIT40V7bJPCVgEGKNEd/T10S/8= + AUsAf69OwA6RS7saPvG+S9a9ZuE= files2 @@ -56,21 +56,21 @@ hash2 - ysCrHXYCmshE7qMMo7QR8+7/hDchoHBZBex4peOleDM= + UbR+ZUQJ8aVVAop/0yUK8DX+HAGDw480Yix/BktCbY4= Resources/available-cli hash2 - 54rajGJtjw4UN2e5PYUBx9p5TCvfJ8uFAiSvob3CU7s= + 9dpnpWe8Q7lFhphWglzO3XSjIqxY/z+XjKs3DU4SpHI= Resources/output-cli hash2 - XmtQcaLbgJCPq4jbnkT/KSGlKWroAOsf9153jjXVacE= + ow2M490m5BP2iXHGXd6Rj0TW2PBymPAI5LKwRsuyAwc= diff --git a/dist/Available.pkgproj b/dist/Available.pkgproj index 43ad60a..4dc1e52 100644 --- a/dist/Available.pkgproj +++ b/dist/Available.pkgproj @@ -515,7 +515,7 @@ USE_HFS+_COMPRESSION VERSION - 1.4.6 + 1.4.7 TYPE 0 diff --git a/src/Available.xcodeproj/project.pbxproj b/src/Available.xcodeproj/project.pbxproj index 2b0a50c..485b224 100644 --- a/src/Available.xcodeproj/project.pbxproj +++ b/src/Available.xcodeproj/project.pbxproj @@ -564,7 +564,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.4.6; + MARKETING_VERSION = 1.4.7; PRODUCT_BUNDLE_IDENTIFIER = com.deviscoding.available; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -601,7 +601,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.4.6; + MARKETING_VERSION = 1.4.7; PRODUCT_BUNDLE_IDENTIFIER = com.deviscoding.available; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -620,7 +620,7 @@ DEVELOPMENT_TEAM = M97V8HVFPX; INFOPLIST_FILE = "$(SRCROOT)/Available/Trunk/Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.4.6; + MARKETING_VERSION = 1.4.7; PRODUCT_BUNDLE_IDENTIFIER = "com.deviscoding.output-cli"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -637,7 +637,7 @@ DEVELOPMENT_TEAM = M97V8HVFPX; INFOPLIST_FILE = "$(SRCROOT)/Available/Trunk/Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.4.6; + MARKETING_VERSION = 1.4.7; PRODUCT_BUNDLE_IDENTIFIER = "com.deviscoding.output-cli"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -655,7 +655,7 @@ DEVELOPMENT_TEAM = M97V8HVFPX; INFOPLIST_FILE = "$(SRCROOT)/Available/Trunk/Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.4.6; + MARKETING_VERSION = 1.4.7; PRODUCT_BUNDLE_IDENTIFIER = "com.deviscoding.available-cli"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -674,7 +674,7 @@ DEVELOPMENT_TEAM = M97V8HVFPX; INFOPLIST_FILE = "$(SRCROOT)/Available/Trunk/Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.4.6; + MARKETING_VERSION = 1.4.7; PRODUCT_BUNDLE_IDENTIFIER = "com.deviscoding.available-cli"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/src/available-cli/Focus.swift b/src/available-cli/Focus.swift index 05e632d..9ddcd64 100644 --- a/src/available-cli/Focus.swift +++ b/src/available-cli/Focus.swift @@ -249,7 +249,7 @@ class FocusMonterey: FocusBase { let assertFile = URL(fileURLWithPath: "\(user.userHome.path)/Library/DoNotDisturb/DB/Assertions.json") let modeConfigFile = URL(fileURLWithPath: "\(user.userHome.path)/Library/DoNotDisturb/DB/ModeConfigurations.json") let jsonDecoder = JSONDecoder() - var manualStart: Int = 0 + var smartStart: Int = 0 if fm.fileExists(atPath: assertFile.path) && fm.fileExists(atPath: modeConfigFile.path) { let calendar = Calendar.current @@ -264,7 +264,7 @@ class FocusMonterey: FocusBase { // seems like a smart trigger, let's get the time for comparison. let ms = (record.assertionStartDateTimestamp + 978307200) * 1000 let dt = calendar.dateComponents([.hour, .minute], from: Date(milliseconds: ms)) - manualStart = (dt.hour ?? 0) * 60 + (dt.minute ?? 0) + smartStart = (dt.hour ?? 0) * 60 + (dt.minute ?? 0) } else { return focus } @@ -281,18 +281,14 @@ class FocusMonterey: FocusBase { let end = triggers.timePeriodEndTimeHour * 60 + triggers.timePeriodEndTimeMinute if (start < end) { if (now >= start && now < end) { - if(manualStart > 0 && manualStart < start) { - if(manualStart > start) { - focus = config.mode.name - } - } else { - focus = config.mode.name - } + if(smartStart == 0 || smartStart < start) { + focus = config.mode.name + } } } else if (start > end) { if (now >= start || now < end) { - if(manualStart > 0) { - if(manualStart >= start || manualStart < end) { + if(smartStart > 0) { + if(smartStart >= start || smartStart < end) { focus = config.mode.name } } else {