diff --git a/Cartfile b/Cartfile index 69880b59..bc6419d2 100644 --- a/Cartfile +++ b/Cartfile @@ -9,4 +9,5 @@ github "soffes/HotKey" github "danielgindi/Charts" github "sparkle-project/Sparkle" github "Clipy/KeyHolder" -github "Clipy/Magnet" \ No newline at end of file +github "Clipy/Magnet" +github "mattt/Surge" ~> 2.0.0 \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved index d698ed31..a1fbdeb2 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -4,9 +4,10 @@ github "Clipy/Magnet" "v2.3.1" github "SwiftyBeaver/SwiftyBeaver" "1.6.2" github "SwiftyJSON/SwiftyJSON" "4.2.0" github "alin23/Solar" "2.2.0" -github "alin23/WAYWindow" "1.1.0" +github "alin23/WAYWindow" "1.0.0" github "danielgindi/Charts" "v3.2.2" github "malcommac/SwiftDate" "5.1.0" +github "mattt/Surge" "2.2.0" github "nerd0geek1/NSPageControl" "v0.1.2" github "soffes/HotKey" "v0.1.1" github "sparkle-project/Sparkle" "1.21.3" diff --git a/Lunar.xcodeproj/project.pbxproj b/Lunar.xcodeproj/project.pbxproj index 85dac471..2fcb5482 100644 --- a/Lunar.xcodeproj/project.pbxproj +++ b/Lunar.xcodeproj/project.pbxproj @@ -57,6 +57,8 @@ C794E1741FEFE31A00549462 /* ScrollableTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C794E1731FEFE31A00549462 /* ScrollableTextField.swift */; }; C794E1771FF01EF500549462 /* Model.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = C794E1751FF01EF500549462 /* Model.xcdatamodeld */; }; C7A2574220EA249B003B3A84 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = C7A2574120EA249B003B3A84 /* dsa_pub.pem */; }; + C7A2BDDA223FC8D100C910E3 /* Surge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7A2BDD9223FC8D100C910E3 /* Surge.framework */; }; + C7A2BDDB223FC8D100C910E3 /* Surge.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C7A2BDD9223FC8D100C910E3 /* Surge.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C7AEC7F91FD0B4350039B562 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AEC7F81FD0B4350039B562 /* AppDelegate.swift */; }; C7AEC7FB1FD0B4350039B562 /* PageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AEC7FA1FD0B4350039B562 /* PageController.swift */; }; C7AEC7FD1FD0B4350039B562 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C7AEC7FC1FD0B4350039B562 /* Assets.xcassets */; }; @@ -88,6 +90,7 @@ dstSubfolderSpec = 10; files = ( C75083572222865F0020270E /* HotKey.framework in Embed Frameworks */, + C7A2BDDB223FC8D100C910E3 /* Surge.framework in Embed Frameworks */, C75083472222865F0020270E /* Solar.framework in Embed Frameworks */, C75083412222865F0020270E /* WAYWindow.framework in Embed Frameworks */, C75083552222865F0020270E /* NSPageControl.framework in Embed Frameworks */, @@ -168,6 +171,7 @@ C794E1731FEFE31A00549462 /* ScrollableTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollableTextField.swift; sourceTree = ""; }; C794E1761FF01EF500549462 /* Model.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Model.xcdatamodel; sourceTree = ""; }; C7A2574120EA249B003B3A84 /* dsa_pub.pem */ = {isa = PBXFileReference; lastKnownFileType = text; name = dsa_pub.pem; path = Lunar/Resources/dsa_pub.pem; sourceTree = ""; }; + C7A2BDD9223FC8D100C910E3 /* Surge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Surge.framework; path = Carthage/Build/Mac/Surge.framework; sourceTree = ""; }; C7AEC7F51FD0B4350039B562 /* Lunar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Lunar.app; sourceTree = BUILT_PRODUCTS_DIR; }; C7AEC7F81FD0B4350039B562 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; C7AEC7FA1FD0B4350039B562 /* PageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageController.swift; sourceTree = ""; }; @@ -212,6 +216,7 @@ C75083482222865F0020270E /* Sparkle.framework in Frameworks */, C75083442222865F0020270E /* Alamofire.framework in Frameworks */, C75083542222865F0020270E /* NSPageControl.framework in Frameworks */, + C7A2BDDA223FC8D100C910E3 /* Surge.framework in Frameworks */, C75083462222865F0020270E /* Solar.framework in Frameworks */, C75083402222865F0020270E /* WAYWindow.framework in Frameworks */, ); @@ -294,6 +299,7 @@ C7AEC7EC1FD0B4350039B562 = { isa = PBXGroup; children = ( + C7A2BDD9223FC8D100C910E3 /* Surge.framework */, C75083362222865D0020270E /* Alamofire.framework */, C75083352222865D0020270E /* Charts.framework */, C750833F2222865F0020270E /* HotKey.framework */, diff --git a/Lunar/AppDelegate.swift b/Lunar/AppDelegate.swift index adbb77e0..54c131e1 100644 --- a/Lunar/AppDelegate.swift +++ b/Lunar/AppDelegate.swift @@ -16,6 +16,13 @@ import Magnet import ServiceManagement import WAYWindow +extension Collection where Index: Comparable { + subscript(back i: Int) -> Iterator.Element { + let backBy = i + 1 + return self[self.index(self.endIndex, offsetBy: -backBy)] + } +} + let TEST_MODE = false var lunarDisplayNames = [ @@ -366,7 +373,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, CLLocationManagerDelegate, N brightnessAdapter.listenForRunningApps() addObservers() - if thisIsFirstRun { + if thisIsFirstRun || TEST_MODE { showWindow() } diff --git a/Lunar/Base.lproj/Main.storyboard b/Lunar/Base.lproj/Main.storyboard index 621ffd86..56824bb8 100644 --- a/Lunar/Base.lproj/Main.storyboard +++ b/Lunar/Base.lproj/Main.storyboard @@ -472,6 +472,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -730,7 +774,7 @@ - + @@ -739,12 +783,13 @@