Text Input
Everything under System Settings › Keyboard › Text Input, as Nix options. Each one is named after the control
you'd click, and set under programs.nix-plist-manager.options in home-manager.
Input Sources
Section titled “Input Sources”Edit… › Add period with double-space
Section titled “Edit… › Add period with double-space”System Settings › Keyboard › Text Input › Input Sources › Edit… › Add period with double-space
applications.systemSettings.keyboard.textInput.addPeriodWithDoubleSpace = true; true or false "unset" puts back macOS's default.
Where it's stored and what runs
-
NSGlobalDomainNSAutomaticPeriodSubstitutionEnabled
For false:
/usr/bin/defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled 2>/dev/null || trueFor true:
/usr/bin/defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool true' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled 2>/dev/null || trueFor unset:
/usr/bin/defaults delete NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled 2>/dev/null || trueEdit… › Automatically switch to a document’s input source
Section titled “Edit… › Automatically switch to a document’s input source”System Settings › Keyboard › Text Input › Input Sources › Edit… › Automatically switch to a document’s input source
applications.systemSettings.keyboard.textInput.automaticallySwitchToADocumentsInputSource = true; true or false
Where it's stored and what runs
-
com.apple.HIToolboxAppleGlobalTextInputProperties
For false:
/usr/bin/defaults write com.apple.HIToolbox AppleGlobalTextInputProperties -dict-add TextInputGlobalPropertyPerContextInput -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write com.apple.HIToolbox AppleGlobalTextInputProperties -dict-add TextInputGlobalPropertyPerContextInput -bool false' >&2/usr/bin/defaults -currentHost delete com.apple.HIToolbox AppleGlobalTextInputProperties 2>/dev/null || trueFor true:
/usr/bin/defaults write com.apple.HIToolbox AppleGlobalTextInputProperties -dict-add TextInputGlobalPropertyPerContextInput -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write com.apple.HIToolbox AppleGlobalTextInputProperties -dict-add TextInputGlobalPropertyPerContextInput -bool true' >&2/usr/bin/defaults -currentHost delete com.apple.HIToolbox AppleGlobalTextInputProperties 2>/dev/null || trueEdit… › Capitalize words automatically
Section titled “Edit… › Capitalize words automatically”System Settings › Keyboard › Text Input › Input Sources › Edit… › Capitalize words automatically
applications.systemSettings.keyboard.textInput.capitalizeWordsAutomatically = true; true or false "unset" puts back macOS's default.
Where it's stored and what runs
-
NSGlobalDomainNSAutomaticCapitalizationEnabled
For false:
/usr/bin/defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticCapitalizationEnabled 2>/dev/null || trueFor true:
/usr/bin/defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool true' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticCapitalizationEnabled 2>/dev/null || trueFor unset:
/usr/bin/defaults delete NSGlobalDomain NSAutomaticCapitalizationEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticCapitalizationEnabled 2>/dev/null || trueEdit… › Correct spelling automatically
Section titled “Edit… › Correct spelling automatically”System Settings › Keyboard › Text Input › Input Sources › Edit… › Correct spelling automatically
applications.systemSettings.keyboard.textInput.correctSpellingAutomatically = true; true or false "unset" puts back macOS's default.
Where it's stored and what runs
-
NSGlobalDomainNSAutomaticSpellingCorrectionEnabled -
NSGlobalDomainWebAutomaticSpellingCorrectionEnabled
For false:
/usr/bin/defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false' >&2/usr/bin/defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -bool false' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticSpellingCorrectionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain WebAutomaticSpellingCorrectionEnabled 2>/dev/null || trueFor true:
/usr/bin/defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool true' >&2/usr/bin/defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -bool true' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticSpellingCorrectionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain WebAutomaticSpellingCorrectionEnabled 2>/dev/null || trueFor unset:
/usr/bin/defaults delete NSGlobalDomain NSAutomaticSpellingCorrectionEnabled 2>/dev/null || true/usr/bin/defaults delete NSGlobalDomain WebAutomaticSpellingCorrectionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticSpellingCorrectionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain WebAutomaticSpellingCorrectionEnabled 2>/dev/null || trueEdit… › All Input Sources
Section titled “Edit… › All Input Sources”System Settings › Keyboard › Text Input › Input Sources › Edit… › All Input Sources
The keyboard layouts and input methods to have, by input source id, e.g. [ "com.apple.keylayout.US" "com.apple.keylayout.ABC" ]; the others are removed. nix run .#current lists the ones in use.
applications.systemSettings.keyboard.textInput.inputSources = [ "…"];A list of strings
Where it's stored and what runs
-
com.apple.HIToolboxAppleEnabledInputSources
For ["…"]:
/usr/bin/osascript -l JavaScript -e 'ObjC.import('\''Carbon'\'');var wanted = ["…"];var id = function (source) { return ObjC.castRefToObject($.TISGetInputSourceProperty(source, $.kTISPropertyInputSourceID)).js; };var isKeyboard = function (source) { return ObjC.castRefToObject($.TISGetInputSourceProperty(source, $.kTISPropertyInputSourceCategory)).js == '\''TISCategoryKeyboardInputSource'\''; };var all = ObjC.castRefToObject($.TISCreateInputSourceList($(), true));var sources = []; for (var i = 0; i < all.count; i++) sources.push(all.objectAtIndex(i));sources.forEach(function (source) { if (wanted.indexOf(id(source)) >= 0) $.TISEnableInputSource(source); });var enabled = ObjC.castRefToObject($.TISCreateInputSourceList($(), false));for (var i = 0; i < enabled.count; i++) { var source = enabled.objectAtIndex(i); if (isKeyboard(source) && wanted.indexOf(id(source)) < 0) $.TISDisableInputSource(source); }' >/dev/null/usr/bin/defaults -currentHost delete com.apple.HIToolbox AppleEnabledInputSources 2>/dev/null || trueEdit… › Show inline predictive text
Section titled “Edit… › Show inline predictive text”System Settings › Keyboard › Text Input › Input Sources › Edit… › Show inline predictive text
applications.systemSettings.keyboard.textInput.showInlinePredictiveText = true; true or false "unset" puts back macOS's default.
Where it's stored and what runs
-
NSGlobalDomainNSAutomaticInlinePredictionEnabled
For false:
/usr/bin/defaults write NSGlobalDomain NSAutomaticInlinePredictionEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticInlinePredictionEnabled -bool false' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticInlinePredictionEnabled 2>/dev/null || trueFor true:
/usr/bin/defaults write NSGlobalDomain NSAutomaticInlinePredictionEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticInlinePredictionEnabled -bool true' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticInlinePredictionEnabled 2>/dev/null || trueFor unset:
/usr/bin/defaults delete NSGlobalDomain NSAutomaticInlinePredictionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticInlinePredictionEnabled 2>/dev/null || trueEdit… › Show suggested replies
Section titled “Edit… › Show suggested replies”System Settings › Keyboard › Text Input › Input Sources › Edit… › Show suggested replies
applications.systemSettings.keyboard.textInput.showSuggestedReplies = true; true or false "unset" puts back macOS's default.
Where it's stored and what runs
-
NSGlobalDomainNSSmartReplyEnabled
For false:
/usr/bin/defaults write NSGlobalDomain NSSmartReplyEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSSmartReplyEnabled -bool false' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSSmartReplyEnabled 2>/dev/null || trueFor true:
/usr/bin/defaults write NSGlobalDomain NSSmartReplyEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSSmartReplyEnabled -bool true' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSSmartReplyEnabled 2>/dev/null || trueFor unset:
/usr/bin/defaults delete NSGlobalDomain NSSmartReplyEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSSmartReplyEnabled 2>/dev/null || trueEdit… › Use smart quotes and dashes
Section titled “Edit… › Use smart quotes and dashes”System Settings › Keyboard › Text Input › Input Sources › Edit… › Use smart quotes and dashes
applications.systemSettings.keyboard.textInput.useSmartQuotesAndDashes = true; true or false "unset" puts back macOS's default.
Where it's stored and what runs
-
NSGlobalDomainNSAutomaticDashSubstitutionEnabled -
NSGlobalDomainNSAutomaticQuoteSubstitutionEnabled
For false:
/usr/bin/defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false' >&2/usr/bin/defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticDashSubstitutionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled 2>/dev/null || trueFor true:
/usr/bin/defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool true' >&2/usr/bin/defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool true' >&2/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticDashSubstitutionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled 2>/dev/null || trueFor unset:
/usr/bin/defaults delete NSGlobalDomain NSAutomaticDashSubstitutionEnabled 2>/dev/null || true/usr/bin/defaults delete NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticDashSubstitutionEnabled 2>/dev/null || true/usr/bin/defaults -currentHost delete NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled 2>/dev/null || true