From 504e460811904423a3a90a71b848a335f7be5d15 Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Fri, 5 Oct 2018 15:40:16 +0200 Subject: [PATCH 1/4] Bump version to 0.5.2 --- Gray.xcodeproj/project.pbxproj | 4 ++++ README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gray.xcodeproj/project.pbxproj b/Gray.xcodeproj/project.pbxproj index 361a35c..551a94c 100644 --- a/Gray.xcodeproj/project.pbxproj +++ b/Gray.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ BD1BA9BE215E68840052633B /* IconController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1BA9BD215E68840052633B /* IconController.swift */; }; BD1BA9C0215E6DBB0052633B /* ApplicationGridView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1BA9BF215E6DBB0052633B /* ApplicationGridView.swift */; }; BD1D9545215E435F003ABBCF /* VersionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1D9544215E435F003ABBCF /* VersionController.swift */; }; + BD2AA1E62167A0E4000717B7 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = BD2AA1E52167A0E4000717B7 /* README.md */; }; BD30844A215C198D002A9349 /* ApplicationsLogicController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD308449215C198D002A9349 /* ApplicationsLogicController.swift */; }; BD67CE0E215BF15F00216FDB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD67CE0D215BF15F00216FDB /* AppDelegate.swift */; }; BD67CE10215BF16100216FDB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD67CE0F215BF16100216FDB /* Assets.xcassets */; }; @@ -35,6 +36,7 @@ BD1BA9BD215E68840052633B /* IconController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconController.swift; sourceTree = ""; }; BD1BA9BF215E6DBB0052633B /* ApplicationGridView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationGridView.swift; sourceTree = ""; }; BD1D9544215E435F003ABBCF /* VersionController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionController.swift; sourceTree = ""; }; + BD2AA1E52167A0E4000717B7 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; BD308449215C198D002A9349 /* ApplicationsLogicController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationsLogicController.swift; sourceTree = ""; }; BD67CE0A215BF15F00216FDB /* Gray.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Gray.app; sourceTree = BUILT_PRODUCTS_DIR; }; BD67CE0D215BF15F00216FDB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -98,6 +100,7 @@ BD67CE01215BF15F00216FDB = { isa = PBXGroup; children = ( + BD2AA1E52167A0E4000717B7 /* README.md */, BD9F0C532166997900608FD9 /* Gray.entitlements */, BD111047215CEB8E0002D537 /* Sources */, BD67CE0C215BF15F00216FDB /* Resources */, @@ -325,6 +328,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + BD2AA1E62167A0E4000717B7 /* README.md in Resources */, BD67CE10215BF16100216FDB /* Assets.xcassets in Resources */, BD67CE13215BF16100216FDB /* MainMenu.xib in Resources */, ); diff --git a/README.md b/README.md index 8325a11..e756af2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Gray Icon -Current version: 0.5.1 [[Download](https://github.com/zenangst/Gray/releases/download/0.5.1/Gray.zip)] +Current version: 0.5.2 [[Download](https://github.com/zenangst/Gray/releases/download/0.5.2/Gray.zip)] Ever wanted to have light and dark apps live side-by-side in harmony? Well, now you can. With **Gray** you can pick between the light appearance and the dark appearance on a per-app basis with the click of a button. From 7aa83b16b3fb368aaa5d8d98f3ad24e72f6686b5 Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Fri, 5 Oct 2018 15:40:51 +0200 Subject: [PATCH 2/4] Change version number to 0.5.2 --- Resources/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Info.plist b/Resources/Info.plist index c3c7c89..cc0a88c 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.5.1 + 0.5.2 CFBundleVersion 1 LSApplicationCategoryType From 5ec1c84f1e3a3098de028c7c72a5fbd135e72df9 Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Fri, 5 Oct 2018 15:41:09 +0200 Subject: [PATCH 3/4] Use true/false instead of YES/NO --- .../Applications/Logic/ApplicationsLogicController.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Sources/Applications/Logic/ApplicationsLogicController.swift b/Sources/Applications/Logic/ApplicationsLogicController.swift index 9470cbd..67ad6ea 100644 --- a/Sources/Applications/Logic/ApplicationsLogicController.swift +++ b/Sources/Applications/Logic/ApplicationsLogicController.swift @@ -28,7 +28,14 @@ class ApplicationsLogicController { then handler: @escaping (MainViewController.State) -> Void) { DispatchQueue.global(qos: .userInitiated).async { [weak self] in let shell = Shell() - let newSetting = appearance == .light ? "YES" : "NO" + let newSetting: String + switch appearance { + case .light, .system: + newSetting = "true" + case .dark: + newSetting = "false" + } + let runningApplication = NSRunningApplication.runningApplications(withBundleIdentifier: application.bundleIdentifier).first if !application.url.path.contains("CoreServices") { From 305ec163b81cca640826f4744c38ed8945a82756 Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Fri, 5 Oct 2018 15:41:23 +0200 Subject: [PATCH 4/4] Add NSLog statements for the setting, command and output --- .../Applications/Logic/ApplicationsLogicController.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/Applications/Logic/ApplicationsLogicController.swift b/Sources/Applications/Logic/ApplicationsLogicController.swift index 67ad6ea..8f0b266 100644 --- a/Sources/Applications/Logic/ApplicationsLogicController.swift +++ b/Sources/Applications/Logic/ApplicationsLogicController.swift @@ -62,7 +62,12 @@ class ApplicationsLogicController { """ } - shell.execute(command: command) + NSLog("New settings for \(application.name) = \(newSetting)") + NSLog("command: \(command)") + + let output = shell.execute(command: command) + NSLog("output: (\(output))") + if runningApplication != nil && !application.url.path.contains("CoreServices") { DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {