All Projects → aerobounce → defaults.sh

aerobounce / defaults.sh

Licence: AGPL-3.0 License
 User Defaults Plist → Shell Script converter with Regex filtering

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to defaults.sh

Prephirences
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults
Stars: ✭ 548 (+2640%)
Mutual labels:  preferences, plist
Dotfiles
Setup and install scripts for a new machine + dotfiles for various apps. Linux, Mac, and Mac (Amazon specific) branches are included.
Stars: ✭ 382 (+1810%)
Mutual labels:  homebrew, preferences
scout
Reading and writing in JSON, Plist, YAML and XML data made simple when the data format is not known at build time. Swift library and command-line tool.
Stars: ✭ 110 (+450%)
Mutual labels:  plist, bash-script
XboxDev
Information about XboxDev and issue tracker for the entire XboxDev ecosystem
Stars: ✭ 64 (+220%)
Mutual labels:  homebrew
tuterm
A better way to learn CLI programs.
Stars: ✭ 22 (+10%)
Mutual labels:  bash-script
ienv
Improved shell environment: sane dotfiles backed by my daily work optimized for solarized theme
Stars: ✭ 25 (+25%)
Mutual labels:  defaults
homebrew-proxmark3
Homebrew tap containing proxmark3 software/firmware
Stars: ✭ 23 (+15%)
Mutual labels:  homebrew
l2cu
L²CU: LDraw Linux Command line Utility
Stars: ✭ 14 (-30%)
Mutual labels:  bash-script
coinbash
💰 A bash script (CLI) for displaying crypto currencies market data in a terminal 🖥
Stars: ✭ 110 (+450%)
Mutual labels:  bash-script
AskSinAnalyzer
Analyzer for radio telegrams in a HomeMatic environment
Stars: ✭ 54 (+170%)
Mutual labels:  homebrew
rwloadsim
RWP*Load Simulator - your tool for scripting, simulation and much more. Like having a bit of bash and SQL, a nip of C or Java, a dash of awk, a grain of sed plus drops of secret sauce in one single tool. See https://blogs.oracle.com/database/rwploadsim-oracle-db-performance-simluator for the announcement on the Oracle database blog.
Stars: ✭ 26 (+30%)
Mutual labels:  bash-script
AutoBrew
AutoBrew: Homebrew deployments made easy
Stars: ✭ 71 (+255%)
Mutual labels:  homebrew
homebrew-adobe
@Homebrew tap for @adobe apps and plugins.
Stars: ✭ 24 (+20%)
Mutual labels:  homebrew
OSCP-Prep
Contained is all my reference material for my OSCP preparation. Designed to be a one stop shop for code, guides, command syntax, and high level strategy. One simple clone and you have access to some of the most popular tools used for pentesting.
Stars: ✭ 33 (+65%)
Mutual labels:  bash-script
punic
Punic is a remote cache CLI built for Carthage and Apple .xcframework
Stars: ✭ 25 (+25%)
Mutual labels:  homebrew
mac-cleanup-sh
🗑️ Cleanup script for macOS (DEPRECATED)
Stars: ✭ 1,585 (+7825%)
Mutual labels:  homebrew
actions
🚀 Homebrew's GitHub Actions
Stars: ✭ 60 (+200%)
Mutual labels:  homebrew
homebrew-i386-elf-toolchain
Homebrew formulas for buildling a valid GCC toolchain for the i386-elf target.
Stars: ✭ 62 (+210%)
Mutual labels:  homebrew
fishing-funds
基金,大盘,股票,虚拟货币状态栏显示小应用,基于Electron开发,支持MacOS,Windows,Linux客户端,数据源来自天天基金,蚂蚁基金,爱基金,腾讯证券,新浪基金等
Stars: ✭ 424 (+2020%)
Mutual labels:  homebrew
PXESetupWizard
PXE Setup Wizard. Netboot Debian, Ubuntu, System Rescue CD, FreeDOS and more.
Stars: ✭ 96 (+380%)
Mutual labels:  bash-script

 ds

User Defaults Plist → Shell Script converter.

  • Made for dotfiles
  • Written in Bash
  • Tested on Mojave, Catalina and Big Sur (Although not tested, it should work with older OSes)

asciicast ds demo

Installation

Homebrew

brew install aerobounce/tap/ds

Usage

ds (-d | domain) <(domain | plist-path)>
ds (-c | currentHost) <domain>
ds (-s | save)

ds (-e | --regex) <pattern> (-d | domain) <(domain | plist-path)>
ds (-e | --regex) <pattern> (-c | currentHost) <domain>
ds (-e | --regex) <pattern> (-s | save)

Examples

Regular expression filtering:

### Case Insensitive
$ ds -e '(?i)show' -d "com.apple.finder"

defaults write com.apple.finder "AppleShowAllFiles" -boolean true
defaults write com.apple.finder "ShowHardDrivesOnDesktop" -boolean false
defaults write com.apple.finder "ShowPathbar" -boolean true
...

### Ignore specific keys with an exception
$ ds -e '^(SUEnableAutomaticChecks|(?!SU|NSWindow|NSSplitView|MSApp|NSToolbar).)*$' \
     -d "com.flexibits.fantastical2.mac"

# With this example above, ds skips any keys that start with:
# "SU", "NSWindow", "NSSplitView", "MSApp", "NSToolbar".
# However, "SUEnableAutomaticChecks" is the exception and will not be skipped.

If you came up with other useful expressions, please let me know.

See the preferences of Dock.app on the fly:

$ ds -d com.apple.dock

See the preferences of Music.app on the fly:

$ ds -d com.apple.music

# Dump CurrentHost plist (Note that you just replace `-d` with `-c`, not `-c -d ...`)
$ ds -c com.apple.music

Pipe the result into any command you like:

$ ds -d com.apple.dock | <subl | less | ...>

Export all the user defaults as shell script:

$ ds save

Script that resets preferences of an app while preserving your settings:

#!/usr/bin/env bash

trap 'killall Finder ; open -a Finder >/dev/null 2>&1' EXIT

defaults remove com.apple.finder

defaults write com.apple.finder "AppleShowAllFiles" -boolean true
defaults write com.apple.finder "DisableAllAnimations" -boolean true
...

"Convert" User Defaults?

With defaults, you get either of these:

NeXTStep Format

$ defaults read com.apple.dock

{
    autohide = 1;
    "autohide-delay" = 0;
...

XML Property Lists

$ defaults export com.apple.dock -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>autohide</key>
    <true/>
    <key>autohide-delay</key>
    <real>0.0</real>
...

With ds, you'll get this:

Shell Script

$ ds -d com.apple.dock

#!/usr/bin/env bash

defaults write com.apple.dock "autohide" -boolean true
defaults write com.apple.dock "autohide-delay" -float 0.0
...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].