开发者

How to set desktop wallpaper and screen-saver?

开发者 https://www.devze.com 2022-12-24 06:58 出处:网络
How to set des开发者_如何学JAVAktop wallpaper and screen-saver from cocoa app?If you\'re on Mac OS X 10.6, NSWorkspace has some new methods for setting the desktop picture. The one you want is setDesk

How to set des开发者_如何学JAVAktop wallpaper and screen-saver from cocoa app?


If you're on Mac OS X 10.6, NSWorkspace has some new methods for setting the desktop picture. The one you want is setDesktopImageURL:forScreen:options:error:.

As for screen saver, there's no supported way to do this programatically. You could modify the com.apple.screensaver plist file and set the following keys:

  • moduleName <-- screen saver name
  • idleTime <-- interval in seconds
  • modulePath <-- path to screen saver file

However, this could break at any time so I would not rely on it.

0

精彩评论

暂无评论...
验证码 换一张
取 消