Coder Social home page Coder Social logo

kbprefs's Introduction

kbprefs

Manage macOS defaults / preferences / UserDefaults

Quick start

Copy preferences.example.yaml to ~/.config/preferences/preferences.yaml to get started, then run kbprefs watch. As preferences changes are detected, if they do not match an ignore pattern, they will be updated into preferences.yaml.

mkdir -p ~/.config/preferences
cp preferences.example.yaml ~/.config/preferences/preferences.yaml
swift build --configuration release
.build/release/kbprefs watch

kbprefs can be copied to a somewhere more convenient so it can be used anywhere.

The default output path is ~/.config/preferences/preferences.yaml. It can be changed by passing a -p <some path> option.

When watching for changes, the script uses 100% CPU on a single thread because of the lazy NSApplication run call. It's usually not used for long though.

After watching and making some changes like adjusting mouse cursor size or moving the dock, there will likely be some preferences in the yaml file you did not intend. Remove any of the unwanted preferences.

Use kbprefs export to update values in the preferences file for any matching applications and keys. You can add an value as an empty string then run export to update to the actual value. Ie, add to the yaml file:

user:
  com.apple.universalaccess:
    mouseDriverCursorSize: ""

Then after running kbprefs export will be updated to something like:

user:
  com.apple.universalaccess:
    mouseDriverCursorSize: { float: 1.5 }

Running kbprefs import will write values from the yaml file to the system. This can be used to quickly setup some machine settings to a known state, or to switch between known states using multiple yaml files.

There are no tests.

kbprefs's People

Contributors

agentk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.