Merge pull request #8084 from poiru/systempreferences-setuserdefault
Add systemPreferences.setUserDefault for macOS
This commit is contained in:
commit
2c8ab72269
7 changed files with 169 additions and 11 deletions
|
@ -114,16 +114,30 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSNotificati
|
|||
|
||||
Get the value of `key` in system preferences.
|
||||
|
||||
This API reads from `NSUserDefaults` on macOS, some popular `key` and `type`s
|
||||
are:
|
||||
This API uses `NSUserDefaults` on macOS. Some popular `key` and `type`s are:
|
||||
|
||||
* `AppleInterfaceStyle: string`
|
||||
* `AppleAquaColorVariant: integer`
|
||||
* `AppleHighlightColor: string`
|
||||
* `AppleShowScrollBars: string`
|
||||
* `NSNavRecentPlaces: array`
|
||||
* `NSPreferredWebServices: dictionary`
|
||||
* `NSUserDictionaryReplacementItems: array`
|
||||
* `AppleInterfaceStyle`: `string`
|
||||
* `AppleAquaColorVariant`: `integer`
|
||||
* `AppleHighlightColor`: `string`
|
||||
* `AppleShowScrollBars`: `string`
|
||||
* `NSNavRecentPlaces`: `array`
|
||||
* `NSPreferredWebServices`: `dictionary`
|
||||
* `NSUserDictionaryReplacementItems`: `array`
|
||||
|
||||
### `systemPreferences.setUserDefault(key, type, value)` _macOS_
|
||||
|
||||
* `key` String
|
||||
* `type` String - See [`getUserDefault`][#systempreferencesgetuserdefaultkey-type-macos]
|
||||
* `value` String
|
||||
|
||||
Set the value of `key` in system preferences.
|
||||
|
||||
Note that `type` should match actual type of `value`. An exception is thrown
|
||||
if they don't.
|
||||
|
||||
This API uses `NSUserDefaults` on macOS. Some popular `key` and `type`s are:
|
||||
|
||||
* `ApplePressAndHoldEnabled`: `boolean`
|
||||
|
||||
### `systemPreferences.isAeroGlassEnabled()` _Windows_
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue