https://github.com/bobronium/macossetup
Ultimate macOS configuration tool
https://github.com/bobronium/macossetup
configuration macos
Last synced: 6 days ago
JSON representation
Ultimate macOS configuration tool
- Host: GitHub
- URL: https://github.com/bobronium/macossetup
- Owner: Bobronium
- Created: 2022-01-01T22:24:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-14T13:15:06.000Z (7 months ago)
- Last Synced: 2024-12-29T00:37:13.673Z (6 months ago)
- Topics: configuration, macos
- Language: Shell
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mac**OSS**etup
Ultimate macOS configuration tool
# Usage
In its current state it's just a simple bash script that installs some essential tools for my workflow.
But it's just a temporary placeholder, while I'm building a much more powerfull beast.
Currently you can use it like this (no configuration, it's dumb):
```shell
$ bash <(curl -fsSL https://raw.githubusercontent.com/Bobronium/macOSSetup/HEAD/setup.sh) -vAlready configured: sudo access with Touch ID
Already installed: Command Line Tools for Xcode
Already installed: Oh My ZSH
Already installed: Homebrew
Already installed: uv
Already installed: npm
Already installed: Python 3.8
Already installed: Python 3.9
Already installed: Python 3.10
Already installed: Python 3.11
Already installed: Python 3.12
All done! ✨ 🍰 ✨```
# Wanted features set
## Install/update
- Anything from Homebrew
- Apps from App Store
- Apps from iOS/iPadOS App Store
- Apps from any source (web, ?) (.zip, .dmg) (drag-n-drop, installers)
- Dotfiles
- Terminal
- defaults
- other configs## Sync
- Capture current state of things on working system, including changed `defaults`, installed apps, etc.Check latest ideas and thoughts in https://github.com/Bobronium/macOSSetup/blob/master/src/macossetup/cli.py docs.
##### A lot more TBD# Cheatsheat
### Install and app form .dmg
```bash
# usage: installdmg https://example.com/path/to/pkg.dmg
function installdmg {
set -x
tempd=$(mktemp -d)
curl $1 > $tempd/pkg.dmg
listing=$(sudo hdiutil attach $tempd/pkg.dmg | grep Volumes)
volume=$(echo "$listing" | cut -f 3)
if [ -e "$volume"/*.app ]; then
sudo cp -rf "$volume"/*.app /Applications
elif [ -e "$volume"/*.pkg ]; then
package=$(ls -1 "$volume" | grep .pkg | head -1)
sudo installer -pkg "$volume"/"$package" -target /
fi
sudo hdiutil detach "$(echo "$listing" | cut -f 1)"
rm -rf $tempd
set +x
}
```*Caveats*:
- If .dmg contains an .app installer, it'll still only copy it to /Applications instead of installing it
- Some packages are distributed in .pkg without .dmg
- Some packages are distributed in .zip containing the .app/.pkgSolution to all these caveats would be a config, where apps with their sources could be leasted and described, e.g.:
```yaml
apps:
web:
# will download .dmg, search for .pkg/.app, and upon finding single .app, will copy it to /Applications
- url: https://download.jetbrains.com/python/pycharm-professional-2021.3.1-aarch64.dmg
# will download SomeOtherApp.dmg, look for single file with .app extension, and will launch it
- url: https://example.com/SomeOtherApp.dmg
extension: .app
type: installer
action: launch
# will download DifferentApp.dmg, mount it and install DifferentApp*.pkg, if matched
- url: https://example.com/DifferentApp.dmg
target: DifferentApp*.pkg
action: install
```### Keep iTerm2 settings in git
-
### Install apps from App Store
This script uses apple script language instead of CLI tools to install apps, this might allow to install iOS/iPadOS apps as well
-
### Configuring shortcuts
- [DefaultKeyBinding.dict](http://web.archive.org/web/20160314030051/http://osxnotes.net/keybindings.html)
- [Setting Keyboard Shortcuts from Terminal in macOS](https://www.ryanmo.co/2017/01/05/setting-keyboard-shortcuts-from-terminal-in-macos/)
- [Where are keyboard shortcuts stored (for backup and sync purposes)?](https://apple.stackexchange.com/questions/87619/where-are-keyboard-shortcuts-stored-for-backup-and-sync-purposes)
- [Default Mac OS X System Key Bindings](https://www.hcs.harvard.edu/~jrus/site/system-bindings.html)
- [Creating keyboard shortcuts on the command line](http://hints.macworld.com/article.php?story=20131123074223584)
- [NSStandardKeyBindingResponding](https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding)
- [Cocoa Event Handling Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html)