Since AppKit version 10.7, NSWorkspace.desktopImageForScreen may return a path to a folder instead of a file's URL which is currently the wallpaper. This folder is the the place from where the wallpapers will be sequentially picked up for display. (Search for setDesktopImageURL
in the release notes).
In case the user has set the desktop image to change randomly every thirty minutes or so, is there any way of determining what are the currently active wallpapers per screen in OSX?
Update: Based no the answer by @l'L'l, I created a small Mac OSX app to conveniently find the currently active Wallpapers: https://github.com/musically-ut/whichbg
On
OS X 10.10
there is aSQLite
3.x database nameddesktoppicture.db
. This db file stores info such as the current desktop picture, directory, space, interval, etc. when a timed random desktop picture transition happens or when there's any change to System Preferences > Desktop:Objective-C
Result:
There are quite a few different other ways you can get the data from this file (eg.
NSTask
,Bash
,AppleScript
, etc. This is my preferred solution since it's native mac code; it's simple enough to make portable for something else though.