Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 767 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 767 Bytes

SKWallpaper

Get the current file path location of the currently selected macOS Wallpaper

Usage

// Return an NSURL to the location
NSURL* url = [SKWallPaper getCurrentWallpaperPath:[NSScreen mainScreen]];
// Setting a wallpaper
NSScreen* screen = [NSScreen mainScreen];        
NSError* fail = [SKWallPaper setWallpaperForScreen:@"/Users/username_here/path_to_image/image_name_here.jpg":screen];

if (fail != nil) {
    NSLog(@"%@\n", [fail localizedFailureReason]);
} else {
    NSLog(@"Done!");
}

Want to use this in a Swift project?

Follow this tutorial to find out more

See LICENSE for more details. Copyright (c) 2024, Mustafa Malik.