diff --git a/.gitignore b/.gitignore index a5dc678..3784ad1 100644 --- a/.gitignore +++ b/.gitignore @@ -61,5 +61,3 @@ fastlane/screenshots # Documentation Documentation/docs -/Fluor/Sparkle.framework -/Fluor/Sparkle.framework.dSYM diff --git a/Fluor.xcodeproj/project.pbxproj b/Fluor.xcodeproj/project.pbxproj index e9e7280..4653ae8 100644 --- a/Fluor.xcodeproj/project.pbxproj +++ b/Fluor.xcodeproj/project.pbxproj @@ -42,8 +42,7 @@ 3F8F93BB1EEAC9B900FCE91F /* RuleCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8F93BA1EEAC9B900FCE91F /* RuleCellView.swift */; }; 3F8F93BD1EEAF1EB00FCE91F /* RuleValueTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8F93BC1EEAF1EB00FCE91F /* RuleValueTransformer.swift */; }; 3F9EDD2A245C7BAF0047D1AC /* MenuItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F9EDD29245C7BAF0047D1AC /* MenuItemView.swift */; }; - 3FBE4C262222A3C600782647 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FBE4C202222A22200782647 /* Sparkle.framework */; }; - 3FBE4C272222A3C600782647 /* Sparkle.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3FBE4C202222A22200782647 /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D1A4E4F72F1E4A3C9B7D1123 /* SUUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A4E4F82F1E4A3C9B7D1123 /* SUUpdater.swift */; }; 3FBE4C292222AB0200782647 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 3FBE4C282222AB0200782647 /* dsa_pub.pem */; }; 3FC44EFA1D7F169A0065D433 /* Enums.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FC44EF91D7F169A0065D433 /* Enums.swift */; }; 3FC44EFC1D7F16CB0065D433 /* Items.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FC44EFB1D7F16CB0065D433 /* Items.swift */; }; @@ -68,19 +67,6 @@ 3FF655CA20751D1600C8D2FC /* PFMoveApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FF655C820751D1600C8D2FC /* PFMoveApplication.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; /* End PBXBuildFile section */ -/* Begin PBXCopyFilesBuildPhase section */ - 3FBE4C252222A25200782647 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3FBE4C272222A3C600782647 /* Sparkle.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 3DF3612324C206AD00231BF5 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/MainMenu.strings"; sourceTree = ""; }; @@ -126,7 +112,7 @@ 3F8F93BA1EEAC9B900FCE91F /* RuleCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RuleCellView.swift; sourceTree = ""; }; 3F8F93BC1EEAF1EB00FCE91F /* RuleValueTransformer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RuleValueTransformer.swift; sourceTree = ""; }; 3F9EDD29245C7BAF0047D1AC /* MenuItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuItemView.swift; sourceTree = ""; }; - 3FBE4C202222A22200782647 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = ../../../../pyroh/Dev/Projects/Fluor/Fluor/Sparkle.framework; sourceTree = ""; }; + D1A4E4F82F1E4A3C9B7D1123 /* SUUpdater.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SUUpdater.swift; sourceTree = ""; }; 3FBE4C282222AB0200782647 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = ""; }; 3FC44EF91D7F169A0065D433 /* Enums.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Enums.swift; sourceTree = ""; }; 3FC44EFB1D7F16CB0065D433 /* Items.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Items.swift; sourceTree = ""; }; @@ -165,7 +151,6 @@ files = ( 3FE7B6DB245DF8450027DB39 /* SmoothOperators in Frameworks */, 3F16ECDD23E9D1AC008BC89A /* DefaultsWrapper in Frameworks */, - 3FBE4C262222A3C600782647 /* Sparkle.framework in Frameworks */, 3F15629F23FEDD0000CD0773 /* CoreGeometry in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -251,6 +236,7 @@ 3FF655C920751D1600C8D2FC /* PFMoveApplication.h */, 3FF655C820751D1600C8D2FC /* PFMoveApplication.m */, 3FD0AFA723C8759A00DC9533 /* AppErrorManager.swift */, + D1A4E4F82F1E4A3C9B7D1123 /* SUUpdater.swift */, 3F244070245D73180061960A /* UserNotificationHelper.swift */, ); path = Misc; @@ -279,7 +265,6 @@ 3F7291EC2025BD1E005C9B70 /* Frameworks */ = { isa = PBXGroup; children = ( - 3FBE4C202222A22200782647 /* Sparkle.framework */, ); name = Frameworks; sourceTree = ""; @@ -347,7 +332,6 @@ 3FCD169E1D79793600C57B22 /* Frameworks */, 3FCD169F1D79793600C57B22 /* Resources */, 3FD11B2F207A320800742415 /* Run Script */, - 3FBE4C252222A25200782647 /* Embed Frameworks */, ); buildRules = ( ); @@ -465,6 +449,7 @@ 3F244071245D73180061960A /* UserNotificationHelper.swift in Sources */, 3F0A2A302014BA11009F9610 /* RunningAppsViewController.swift in Sources */, 3FD0AFA823C8759A00DC9533 /* AppErrorManager.swift in Sources */, + D1A4E4F72F1E4A3C9B7D1123 /* SUUpdater.swift in Sources */, 3FE38EAA221D91640019B889 /* Release.swift in Sources */, 3F2CAE6A246038E30046D711 /* UserNotificationEnablementViewController.swift in Sources */, 3F2FA4031D7A059F003E2AD8 /* CurrentAppViewController.swift in Sources */, @@ -626,7 +611,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -680,7 +665,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -693,6 +678,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fluor/Fluor.entitlements; CODE_SIGN_IDENTITY = "Mac Developer"; @@ -710,7 +696,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 2.5.0; PRODUCT_BUNDLE_IDENTIFIER = com.pyrolyse.Fluor; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -727,6 +713,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ARCHS = "$(ARCHS_STANDARD)"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fluor/Fluor.entitlements; CODE_SIGN_IDENTITY = "Mac Developer"; @@ -744,8 +731,9 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 2.5.0; + ONLY_ACTIVE_ARCH = NO; OTHER_SWIFT_FLAGS = "-DRELEASE"; PRODUCT_BUNDLE_IDENTIFIER = com.pyrolyse.Fluor; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Fluor.xcodeproj/xcshareddata/xcschemes/Fluor.xcscheme b/Fluor.xcodeproj/xcshareddata/xcschemes/Fluor.xcscheme index bf0f284..5190496 100644 --- a/Fluor.xcodeproj/xcshareddata/xcschemes/Fluor.xcscheme +++ b/Fluor.xcodeproj/xcshareddata/xcschemes/Fluor.xcscheme @@ -5,24 +5,6 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/Fluor/Misc/SUUpdater.swift b/Fluor/Misc/SUUpdater.swift new file mode 100644 index 0000000..2dd133d --- /dev/null +++ b/Fluor/Misc/SUUpdater.swift @@ -0,0 +1,27 @@ +import AppKit + +@objc(SUUpdater) +final class SUUpdater: NSObject { + + private static let lastUpdateCheckDateKey = "SUUpdater.lastUpdateCheckDate" + + @objc dynamic private(set) var lastUpdateCheckDate: Date? { + didSet { + UserDefaults.standard.set(lastUpdateCheckDate, forKey: Self.lastUpdateCheckDateKey) + } + } + + override init() { + lastUpdateCheckDate = UserDefaults.standard.object(forKey: Self.lastUpdateCheckDateKey) as? Date + super.init() + } + + @objc func checkForUpdates(_ sender: Any?) { + lastUpdateCheckDate = Date() + + guard let updatesURL = URL(string: "https://github.com/Pyroh/Fluor/releases/latest") else { + return + } + NSWorkspace.shared.open(updatesURL) + } +} diff --git a/README.md b/README.md index 4045919..df1c9fe 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![License](https://img.shields.io/badge/license-MIT-71787A.svg)](https://tldrlegal.com/license/mit-license) -![](https://github.com/Pyroh/Fluor/blob/master/ressources/banner.png?raw=true) +![](https://github.com/Pyroh/Fluor/blob/main/ressources/banner.png?raw=true) > Want to know how **Fluor** development is going ? [**Follow me on Twitter**](https://twitter.com/__pyroh). @@ -23,34 +23,34 @@ There's two main ways to install **Fluor**: You can also build it from source, but this is not recommended if your are only going to use **Fluor** in the regular way, and not hack it. # How does it work? - + **Fluor** lies in your status bar and makes you see instantaneously which mode your keyboard is on: -- means that the keyboard's fn keys act like the default Apple function keys. -- means that the keyboard's fn keys act like these good old function keys (F1, F2, F3, you got it...). +- means that the keyboard's fn keys act like the default Apple function keys. +- means that the keyboard's fn keys act like these good old function keys (F1, F2, F3, you got it...). ## Fluor's menu This is what you get when you click on **Fluor** in the status bar: - + You can choose the default mode. Whenever **Fluor** runs it will activate the default mode for your keyboard's fn keys. **Fluor** also displays the active application and its associated rule that you can change on the go. - is the default rule and means that the application will adopt default Fluor's keyboard behaviour. + is the default rule and means that the application will adopt default Fluor's keyboard behaviour. You can also disable **Fluor** if you need to. It will set the keyboard's behaviour as it was prior to the application's launch. ## Rules Editor - + This panel allows you to see all the rules you set at once. You can modify or delete any rule. Adding a rule will prompt a file selector in which you'll be able to select the application you want to set a rule for. ## Running Applications - + -Sometimes it is not possible to select an application in the *Rules Editor*, especially for Steam games. This panel lets you set a rule for any running application. Of course the rules you set in this panel will be available directly in the *Rules Editor*. You can also remove a rule by setting the application behaviour to , it will also disappear from the *Rules Editor* panel. +Sometimes it is not possible to select an application in the *Rules Editor*, especially for Steam games. This panel lets you set a rule for any running application. Of course the rules you set in this panel will be available directly in the *Rules Editor*. You can also remove a rule by setting the application behaviour to , it will also disappear from the *Rules Editor* panel. # Why is it open source ? I made **Fluor** because I needed such an application. I wanted it simple, nicely designed and free and I didn't find such a thing on the internet. Once it was done I used it for a little while, cleaned up the code and decided to give it to others for free. What was a requirement for me can well be a requirement for others too.