Skip to content

Console utility to manage mac settings, including generating AppleScript to be able to apply at startup or ad-hoc

License

Notifications You must be signed in to change notification settings

lopperman/mac_configurator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Mac System Configurator

Manage and apply Mac system settings with ease through a beautiful command-line interface.

Overview

This tool manages macOS system settings through configuration profiles. Create different profiles for different scenarios (Work, Home, Presentation, etc.) and switch between them effortlessly.


๐Ÿ’ป Command-Line Interface

A fully-featured terminal application with a beautiful Rich-powered UI.

Features

  • โœ… Multiple configuration profiles
  • โœ… JSON Schema-based settings validation
  • โœ… Live system value comparison
  • โœ… Rich terminal UI with tables and panels
  • โœ… Generate AppleScript for startup execution
  • โœ… Manage startup items, background apps, and system extensions
  • โœ… Admin permission handling

Quick Start

# Install dependencies
pip3 install rich jsonschema

# Run the configurator
python3 python_app/mac_configurator.py

# Or create an alias for quick access
echo "alias cfg='python3 $(pwd)/python_app/mac_configurator.py'" >> ~/.zshrc
source ~/.zshrc
cfg

๐Ÿ“– Full CLI documentation โ†’


Available Settings

Comprehensive set of macOS settings:

๐ŸŒ Network

  • WiFi enabled/disabled (requires admin)

๐Ÿ”Š Audio

  • Input muted
  • Output volume (0-100)

๐Ÿ“ฑ Dock

  • Auto-hide
  • Position (left/bottom/right)

๐Ÿ“ Finder

  • Show hidden files
  • Show all file extensions

โš™๏ธ System

  • Screenshot save location

๐Ÿš€ Startup Items

  • Block/allow applications from launching at login

โฑ๏ธ Background Apps

  • Control background app permissions

๐Ÿ”Œ System Extensions

  • Enable/disable system extensions
  • Manage widgets, Safari extensions, Quick Look plugins, etc.

Configuration

Configuration Directory

The app uses ~/MacConfigurator/ to store configuration profiles:

~/MacConfigurator/
โ”œโ”€โ”€ Work_config.json
โ”œโ”€โ”€ Home_config.json
โ”œโ”€โ”€ Presentation_config.json
โ””โ”€โ”€ apply_Work_settings.scpt

Settings Schema

Settings are defined in shared/settings_schema.json using JSON Schema format for validation.

Configuration Format

Example Work_config.json:

{
  "settings": {
    "audio_output_volume": 50,
    "dock_position": "bottom",
    "dock_autohide": false,
    "wifi_enabled": true
  }
}

Project Structure

mac_configurator/
โ”œโ”€โ”€ python_app/              # Python CLI application
โ”‚   โ”œโ”€โ”€ mac_configurator.py  # Main CLI script
โ”‚   โ”œโ”€โ”€ README.md            # CLI documentation
โ”‚   โ””โ”€โ”€ screenshots/         # CLI interface examples
โ”‚
โ””โ”€โ”€ shared/                  # Shared resources
    โ””โ”€โ”€ settings_schema.json # Settings definitions

Development

Adding New Settings

The schema-first approach:

  1. Update shared/settings_schema.json

    {
      "your_setting_key": {
        "type": "boolean",
        "title": "Your Setting Name",
        "description": "What this setting does",
        "category": "CategoryName",
        "handler": "YourHandler",
        "requires_admin": false
      }
    }
  2. Implement handler in Python

    • Add getter/setter methods
    • Register in handler map

Contributing

Contributions are welcome!


Requirements

  • macOS
  • Python 3.7+
  • rich library
  • jsonschema library

License

View License


Screenshots

The configurator features a beautiful, color-coded Rich terminal interface:

Main Menu

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                   Mac System Configurator                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Config directory: ~/MacConfigurator

    Available
    Configurations

โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ # โ”‚ Config Name โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 1 โ”‚ Work        โ”‚
โ”‚ 2 โ”‚ Home        โ”‚
โ”‚ 3 โ”‚ Presentationโ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ [1] โ”‚ Edit Config (select number)  โ”‚
โ”‚     โ”‚ Create New Config            โ”‚
โ”‚     โ”‚ Delete a Config              โ”‚
โ”‚ [e] โ”‚ Exit                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Select option: โ–Œ

Manage Settings - Category Selection

Manage Settings - Select Category

โ”Œโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ [1] โ”‚ ๐ŸŒ Network     โ”‚
โ”‚ [2] โ”‚ ๐Ÿ”Š Audio       โ”‚
โ”‚ [3] โ”‚ ๐Ÿ“ฑ Dock        โ”‚
โ”‚ [4] โ”‚ ๐Ÿ“ Finder      โ”‚
โ”‚ [5] โ”‚ โš™๏ธ  System     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Press Enter to return to main menu

Select category (): โ–Œ

Categories are color-coded for easy identification.

Finder Settings View

Finder Settings

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Option โ”‚ Setting              โ”‚ Configured โ”‚ Current โ”‚ Status โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ [1]    โ”‚ Show Hidden Files    โ”‚ False      โ”‚ False   โ”‚   โœ“    โ”‚
โ”‚ [2]    โ”‚ Show All Extensions  โ”‚ True       โ”‚ True    โ”‚   โœ“    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Press Enter to return to category menu

Select setting to edit (): โ–Œ

Settings display shows:

  • Configured (Yellow) = Your configured values
  • Current (Magenta) = Current actual system values
  • โœ“ = Matched (settings in sync)
  • โš  = Mismatched (configured value differs from system)
  • โ—‹ = Not configured (using system defaults)
  • ๐Ÿ”’ = Requires admin privileges

AppleScript Generation

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ AppleScript Generated โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœ“ Script saved to: ~/MacConfigurator/apply_Work_settings.scpt

To run manually:
  osascript ~/MacConfigurator/apply_Work_settings.scpt

To add to startup:
  1. Open System Settings > General > Login Items
  2. Click '+' under 'Open at Login'
  3. Select: ~/MacConfigurator/apply_Work_settings.scpt

Press Enter to continue...โ–Œ

Roadmap

Completed โœ…

  • Core settings management
  • Multiple profiles
  • AppleScript generation
  • Startup items management
  • System extensions management

Future Enhancements

  • Additional system settings
  • Configuration import/export
  • Settings templates
  • Automated testing framework

Made with โค๏ธ for macOS

About

Console utility to manage mac settings, including generating AppleScript to be able to apply at startup or ad-hoc

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages