diff --git a/README.md b/README.md index 30805bc..62ef835 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ And much more! (30 in total) RPFX uses [his fork](https://github.com/PKBeam/SwordRPC) of [Azoy's SwordRPC](https://github.com/Azoy/SwordRPC). ## System Requirements -- macOS Big Sur (11.0) (Apple Silicon, Intel) +- macOS Big Sur (11.0-12.3) (Apple Silicon, Intel) - Xcode and Discord (Stable or PTB) installed (otherwise this program isn't very useful) ## Usage diff --git a/RPFX/AppDelegate.swift b/RPFX/AppDelegate.swift index ed7a0e8..f750229 100644 --- a/RPFX/AppDelegate.swift +++ b/RPFX/AppDelegate.swift @@ -24,6 +24,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { var rp = RichPresence() let fn = getActiveFilename() let ws = getActiveWorkspace() + + //Xcode logo + rp.assets.largeImage = discordRPImageKeyXcode // determine file type // reconising file type only works on playgrounds for some reason @@ -31,9 +34,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { rp.details = "Editing \(fileName)" // do we recognise this file type? if let fileExt = getFileExt(fileName), discordRPImageKeys.contains(fileExt) { - rp.assets.largeImage = fileExt + rp.assets.smallImage = fileExt } else { - rp.assets.largeImage = discordRPImageKeyDefault + rp.assets.smallImage = discordRPImageKeyDefault } } @@ -43,10 +46,18 @@ class AppDelegate: NSObject, NSApplicationDelegate { } // Xcode was just launched? - if fn == nil && ws == nil { + if fn == "" && ws == nil { rp.assets.largeImage = discordRPImageKeyXcode + rp.assets.smallImage = nil rp.details = "No file open" } + + //Xcode is in Playground? + if fn == nil, let workspace = ws { + rp.assets.largeImage = discordRPImageKeyXcode + rp.assets.smallImage = discordRPImageKeys[20] + rp.state = "Editing \(withoutFileExt(workspace))" + ".playground" + } // set timestamps rp.timestamps.start = connectionStartDate diff --git a/RPFX/Applescript.swift b/RPFX/Applescript.swift index 6c4cb02..42a069f 100644 --- a/RPFX/Applescript.swift +++ b/RPFX/Applescript.swift @@ -67,7 +67,7 @@ func getActiveFilename() -> String? { if !fileNames.contains(myString[0]) { return window - } + } } return nil