Re: How to change settings of my screen saver on the command line
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=1a1hai; bh=WUqwVKkcfCbD6tuxb0Z4836dBzEiEV2q/FfpgRcbEE4=; h=From:Content-Type:Mime-Version:Subject:Date:To:Message-Id:x-icloud-hme; b=syZG3yYrzsRm9ndC0jLwsuBplsrKPW5FwcQ5VPSgbhPY0wy9BBCaf7JJ1va54wLza hKiXpsO/S8Zp5MCI7J+9jqqH9L5TCYeFlWU88ZD9LOv1igd/luS8xpWsCVAOgIBv28 ZNwUaatR2ONTYcN85LCZgPshjVnOiPhMyZQ+k9PZWDUayWm5pv1+GusTMl+TScZcDn yUzvaIbiQ4Dq+rQPV8gvjLto9jQqKF6MV4i4WOHipDXYo2gnc4h4FsPgCaN27TJ07+ KpnukDoY8wFsMUyoaGBQso9m29n5YeSN2ShJTYDsTiYe6486TBKDLljD3yWNNxGqQm DT5lYOlyzl4vQ== On Mar 26, 2025, at 08:08, Gabriel Zachmann via Cocoa-dev <cocoa-dev@lists.apple.com> wrote:
I have a screensaver that uses a number of settings the user can change through the Options in System Settings.
It uses several dictionaries, one per display type (built-in, external monitor, ...).
In an app, I would use this command line to change one of the settings (while the app is not running):
defaults write de.zach.ArtSaverApp "Built-in Retina Display_0" -dict-add FontName -string "Museo Slab"
Does anybody know, if/how I could achieve the same thing with my screen saver?
If you read 'man defaults', you'll see that you should be able to manipulate a defaults file by its path. However, when I try it on my legacy screensaver's plists, it fails, saying the file doesn't exist. Even when using sudo, it can't find it. If I list the known domains, my screensaver is not listed. This is all likely because legacyscreensaver hides everything under its own Container. ~/Library/Containers/com.apple.ScreenSaver.Engine.legacyScreenSaver/Data/Library/Preferences/ByHost/com.your.domain.screenID-hex-number.plist -- Steve Mills Drummer, Mac geek Why do you need to write to your screensavers prefs outside of the System Prefs window? Debugging? If so, just add temporary lines of code that manipulate the prefs when your screensaver loads: #if DEBUG ScreenSaverDefaults* prefs = [ScreenSaverDefaults defaultsForModuleWithName:MyModuleName]; [prefs setBlah:x forKey:kKey]; #endif -- Steve Mills Drummer, Mac geek _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Steve Mills via Cocoa-dev