Skip to content

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

License

Notifications You must be signed in to change notification settings

SpareKit/SKWallpaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published