Skip to content

Commit

Permalink
use default desktop from CoreServices
Browse files Browse the repository at this point in the history
  • Loading branch information
Clkw0rk committed Oct 30, 2023
1 parent 7cdf884 commit c2c99e2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions XCreds/DefaultsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
import Cocoa

class DefaultsHelper: NSObject {

static func backgroundImage(includeDefault:Bool=true) -> NSImage? {
let coreServicesDefaultImagePathUrl: String = "file:///System/Library/CoreServices/DefaultDesktop.heic"
TCSLogWithMark()
if let imagePathURL = DefaultsOverride.standardOverride.string(forKey: PrefKeys.loginWindowBackgroundImageURL.rawValue), let image = NSImage.imageFromPathOrURL(pathURLString: imagePathURL){

return image

}
else if includeDefault == true {
// Try to use default desktop
if let coreServicesDefaultImage = NSImage.imageFromPathOrURL(pathURLString: coreServicesDefaultImagePathUrl) {
TCSLogWithMark("Using CoreServices Default Desktop image")
return coreServicesDefaultImage
}
if includeDefault == true {
let allBundles = Bundle.allBundles
for currentBundle in allBundles {
TCSLogWithMark(currentBundle.bundlePath)
Expand Down

0 comments on commit c2c99e2

Please sign in to comment.