macOS: distinguish between Debug and Release(Stable/Tip) (#9149)
### Background Been running Ghostty locally for a while now, and I use the Finder service a lot. It often confuses me which one is the official one, until I actually open it. ### Changes - Use blueprint to distinguish from release app, if no custom icon specified - Change BundleDisplayName to Ghostty[Debug] - Enable Info.plist preprocessing for reading `$(INFOPLIST_KEY_CFBundleDisplayName)` for providing different services with different configurations > (Preprocessing was once reverted before](https://github.com/ghostty-org/ghostty/commit/6508fec), so I'm not sure whether this follows the 'rules' here, but for now, there are no links in the plist file, so I think it’s [safe](https://developer.apple.com/library/archive/technotes/tn2175/_index.html#:~:text=can%20pass%20the-,%2Dtraditional,-flag%20to%20the) to enable itpull/9170/head
parent
8d8821004e
commit
03e71e86a4
|
|
@ -61,7 +61,7 @@
|
||||||
<key>NSMenuItem</key>
|
<key>NSMenuItem</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>default</key>
|
<key>default</key>
|
||||||
<string>New Ghostty Tab Here</string>
|
<string>New $(INFOPLIST_KEY_CFBundleDisplayName) Tab Here</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>NSMessage</key>
|
<key>NSMessage</key>
|
||||||
<string>openTab</string>
|
<string>openTab</string>
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
<key>NSMenuItem</key>
|
<key>NSMenuItem</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>default</key>
|
<key>default</key>
|
||||||
<string>New Ghostty Window Here</string>
|
<string>New $(INFOPLIST_KEY_CFBundleDisplayName) Window Here</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>NSMessage</key>
|
<key>NSMessage</key>
|
||||||
<string>openWindow</string>
|
<string>openWindow</string>
|
||||||
|
|
|
||||||
|
|
@ -553,6 +553,7 @@
|
||||||
INFOPLIST_KEY_NSRemindersUsageDescription = "A program running within Ghostty would like to access your reminders.";
|
INFOPLIST_KEY_NSRemindersUsageDescription = "A program running within Ghostty would like to access your reminders.";
|
||||||
INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "A program running within Ghostty would like to use speech recognition.";
|
INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "A program running within Ghostty would like to use speech recognition.";
|
||||||
INFOPLIST_KEY_NSSystemAdministrationUsageDescription = "A program running within Ghostty requires elevated privileges.";
|
INFOPLIST_KEY_NSSystemAdministrationUsageDescription = "A program running within Ghostty requires elevated privileges.";
|
||||||
|
INFOPLIST_PREPROCESS = YES;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
|
|
@ -775,7 +776,7 @@
|
||||||
EXECUTABLE_NAME = ghostty;
|
EXECUTABLE_NAME = ghostty;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = "Ghostty-Info.plist";
|
INFOPLIST_FILE = "Ghostty-Info.plist";
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = Ghostty;
|
INFOPLIST_KEY_CFBundleDisplayName = "Ghostty[DEBUG]";
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
|
||||||
INFOPLIST_KEY_NSAppleEventsUsageDescription = "A program running within Ghostty would like to use AppleScript.";
|
INFOPLIST_KEY_NSAppleEventsUsageDescription = "A program running within Ghostty would like to use AppleScript.";
|
||||||
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "A program running within Ghostty would like to use Bluetooth.";
|
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "A program running within Ghostty would like to use Bluetooth.";
|
||||||
|
|
@ -793,6 +794,7 @@
|
||||||
INFOPLIST_KEY_NSRemindersUsageDescription = "A program running within Ghostty would like to access your reminders.";
|
INFOPLIST_KEY_NSRemindersUsageDescription = "A program running within Ghostty would like to access your reminders.";
|
||||||
INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "A program running within Ghostty would like to use speech recognition.";
|
INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "A program running within Ghostty would like to use speech recognition.";
|
||||||
INFOPLIST_KEY_NSSystemAdministrationUsageDescription = "A program running within Ghostty requires elevated privileges.";
|
INFOPLIST_KEY_NSSystemAdministrationUsageDescription = "A program running within Ghostty requires elevated privileges.";
|
||||||
|
INFOPLIST_PREPROCESS = YES;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
|
|
@ -847,6 +849,7 @@
|
||||||
INFOPLIST_KEY_NSRemindersUsageDescription = "A program running within Ghostty would like to access your reminders.";
|
INFOPLIST_KEY_NSRemindersUsageDescription = "A program running within Ghostty would like to access your reminders.";
|
||||||
INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "A program running within Ghostty would like to use speech recognition.";
|
INFOPLIST_KEY_NSSpeechRecognitionUsageDescription = "A program running within Ghostty would like to use speech recognition.";
|
||||||
INFOPLIST_KEY_NSSystemAdministrationUsageDescription = "A program running within Ghostty requires elevated privileges.";
|
INFOPLIST_KEY_NSSystemAdministrationUsageDescription = "A program running within Ghostty requires elevated privileges.";
|
||||||
|
INFOPLIST_PREPROCESS = YES;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
|
|
@ -865,7 +868,7 @@
|
||||||
A5D449A82B53AE7B000F5B83 /* Debug */ = {
|
A5D449A82B53AE7B000F5B83 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = Ghostty;
|
ASSETCATALOG_COMPILER_APPICON_NAME = "Ghostty-Debug";
|
||||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,12 @@ class AppDelegate: NSObject,
|
||||||
/// The custom app icon image that is currently in use.
|
/// The custom app icon image that is currently in use.
|
||||||
@Published private(set) var appIcon: NSImage? = nil {
|
@Published private(set) var appIcon: NSImage? = nil {
|
||||||
didSet {
|
didSet {
|
||||||
|
#if DEBUG
|
||||||
|
// if no custom icon specified, we use blueprint to distinguish from release app
|
||||||
|
NSApplication.shared.applicationIconImage = appIcon ?? NSImage(named: "BlueprintImage")
|
||||||
|
#else
|
||||||
NSApplication.shared.applicationIconImage = appIcon
|
NSApplication.shared.applicationIconImage = appIcon
|
||||||
|
#endif
|
||||||
let appPath = Bundle.main.bundlePath
|
let appPath = Bundle.main.bundlePath
|
||||||
NSWorkspace.shared.setIcon(appIcon, forFile: appPath, options: [])
|
NSWorkspace.shared.setIcon(appIcon, forFile: appPath, options: [])
|
||||||
NSWorkspace.shared.noteFileSystemChanged(appPath)
|
NSWorkspace.shared.noteFileSystemChanged(appPath)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue