Wallpaper (macOS): uses the official API if possible

This commit is contained in:
李通洲
2026-08-09 10:27:19 +08:00
parent 1d4b0236ac
commit e3b8e94055
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -12,3 +12,4 @@ fastfetch.kdev4
*.user
*.user.*
*.swp
*.log
+11
View File
@@ -3,9 +3,20 @@
#include "common/apple/osascript.h"
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
const char* ffDetectWallpaper(FFstrbuf* result)
{
{
// Reliable for user-picked static images.
NSURL* url = [NSWorkspace.sharedWorkspace desktopImageURLForScreen:NSScreen.mainScreen];
if (url.fileURL && ![url.path isEqualToString:@"/System/Library/CoreServices/DefaultDesktop.heic"] /* dynamic wallpapers */)
{
ffStrbufSetS(result, url.path.UTF8String);
return nullptr;
}
}
{
// For Sonoma
// https://github.com/JohnCoates/Aerial/issues/1332