forked from trulyspinach/SMCAMDProcessor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aece378
commit c55f0e0
Showing
8 changed files
with
287 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
<key>com.apple.security.files.user-selected.read-only</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// AppDelegate.swift | ||
// APGLaunchHelper | ||
// | ||
// Created by Qi HaoYan on 7/30/21. | ||
// Copyright © 2021 trulyspinach. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
class AppDelegate: NSObject, NSApplicationDelegate { | ||
|
||
func applicationDidFinishLaunching(_ aNotification: Notification) { | ||
let runningApps = NSWorkspace.shared.runningApplications | ||
print("hello world") | ||
let isRunning = runningApps.contains { | ||
$0.bundleIdentifier == "wtf.spinach.AMD-Power-Gadget" | ||
} | ||
|
||
if !isRunning { | ||
var path = URL(fileURLWithPath: Bundle.main.bundlePath as String) | ||
|
||
for _ in 1...4 { | ||
path = path.deletingLastPathComponent() | ||
} | ||
|
||
let config = NSWorkspace.OpenConfiguration() | ||
NSWorkspace.shared.openApplication(at: path, configuration: config) { instance, e in | ||
exit(0) | ||
} | ||
} | ||
|
||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIconFile</key> | ||
<string></string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2021 trulyspinach. All rights reserved.</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
<key>LSBackgroundOnly</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// main.swift | ||
// APGLaunchHelper | ||
// | ||
// Created by Qi HaoYan on 7/30/21. | ||
// Copyright © 2021 trulyspinach. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
let delegate = AppDelegate() | ||
NSApplication.shared.delegate = delegate | ||
NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv) |
Oops, something went wrong.