Skip to content

Commit 2e5b559

Browse files
committed
Adds README
1 parent cc07bae commit 2e5b559

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
# user-defaults
2-
Wrapper for macOS defaults
1+
# macOS User Defaults (`user-defaults`)
2+
Wrapper for macOS defaults, designed for running with admin privileges to read/write the defaults of another user.
3+
4+
## Usage
5+
6+
Usage remains the same as the native macOS defaults command, with the following additional flags:
7+
8+
| Flag | Description |
9+
|------------|------------------------------------------------------------------------------------------------------|
10+
| `-user` | The user to read/write the preferences with. |
11+
| `-quiet` | Does not show error output or confirmations. In the case of a read command, only the value is shown. |
12+
| `-force` | When writing, will ignore the existence of a Managed Preference and write the value anyway. |
13+
| `-version` | Displays the version |
14+
15+
When using the `-user` flag, written preferences are stored in the user's library unless the domain specified is an absolute path.
16+
17+
## Additional Conveniences
18+
19+
* If writing, the user's defaults are automatically reloaded. This ensures the following:
20+
* The change is effective immediately.
21+
* The System Settings (or System Preferences) shows the updated value.
22+
* If writing, warns about attempting to modify Managed Preferences and aborts unless `--force` flag is used
23+
* Any boolean-like value is automatically saved as a boolean, unless a different type is specified.
24+
* Includes: `YES|Yes|yes|NO|No|no|TRUE|True|true|FALSE|False|false|1|0`
25+
* A domain of `.GlobalPreferences` is automatically changed to `-g` for compatibility.
26+
27+
## Optional Installer Script
28+
If your script is running as root, you can silently install the library using the 1-liner below:
29+
30+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/jonesiscoding/user-defaults/HEAD/bin/install.sh)" || exit 1
31+
The installer will check this repo for the most recent release, then if needed, download & install to `/usr/local/sbin/user-defaults`.

src/user-defaults

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
binDefaults="/usr/bin/defaults"
66
binReload="/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings"
7-
version="1.0.1"
7+
version="1.1"
88

99
## endregion ########################################### End Static Variables
1010

0 commit comments

Comments
 (0)