GithubHelp home page GithubHelp logo

scriptingosx / prefstool Goto Github PK

View Code? Open in Web Editor NEW
63.0 9.0 7.0 10 KB

License: Apache License 2.0

Python 100.00%
mac macos macadmin preferences configuration-profile preference-domain python

prefstool's Introduction

prefs Tools

This tool is an extension of Greg Neagle's fancy_defaults_read.py.

In the simplest use case you can just pass the app identifier:

$ ./prefs.py com.apple.screensaver
idleTime <int>: 0L (User/ByHost)
CleanExit <string>: u'YES' (User/ByHost)
askForPassword <bool>: True (Managed)
askForPasswordDelay <int>: 0L (Managed)
moduleDict <dict>: {
    moduleName = iLifeSlideshows;
    path = "/System/Library/Frameworks/ScreenSaver.framework/Resources/iLifeSlideshows.saver";
    type = 0;
} (User/ByHost)
showClock <bool>: True (User/ByHost)
PayloadUUID <string>: u'AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE' (Managed)
tokenRemovalAction <int>: 0L (User/ByHost)
PrefsVersion <int>: 100L (User/ByHost)

The tool will print all composited preferences keys and their type and value, with the preference domain where the value was set. The output format is:

prefKey <type>: value (domain)

A preference domain of Managed means the value is set with a configuration profile.

While preference values set in .GlobalPreferences.plist in the different domains are composited into the the application defaults, they are not shown by default, since there are many of them and they will make the output fairly unreadable. If you want to see them add the --globals (or -g option):

$ ./prefs.py --globals com.apple.screensaver

You can also add one or more keys after the app identifier to get just specific values:

$ ./prefs.py com.apple.screensaver askForPassword askForPasswordDelay AppleLocale
askForPassword <bool>: True (Managed)
askForPasswordDelay <int>: 0L (Managed)
AppleLocale <string>: u'en_NL' (User/Global)

You can also add the --value (or -V) option to show just the value in the output (might be useful when you want to get the composited value for another script.

$ ./prefs.py -V com.apple.screensaver askForPassword
True

To do:

  • determine the configuration profile a setting came from
  • set or delete values in a certain domain
  • read keys or values in nested arrays or dicts

(inherited from fancy_defaults_read.py)

  • Instead of '/Library/Preferences/ByHost/com.apple.screensaver.xxxx.plist', print the actual filename.
  • Add support for sandboxed applications that store their preferences in ~/Library/Containers//Data/Library/Preferences/.plist

prefstool's People

Contributors

scriptingosx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prefstool's Issues

Catalina

Hey! Any plans to keep working on this and updating for Catalina?
I'm a notorious tinkerer and automator myself -- lots of good stuff here in your repo :)

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.