Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

macc

A macOS control CLI built with Zig. Control audio, display, appearance, Bluetooth, input method, Finder, Dock, and more — all from your terminal.

Install

zig build -Doptimize=ReleaseFast
cp zig-out/bin/macc /usr/local/bin/

Requires macOS and Zig >= 0.16.0.

Commands

Audio

Switch default input/output audio devices.

macc audio output list              # List output devices (* = current)
macc audio output get               # Show current default
macc audio output set "MacBook Pro Speakers"

macc audio input list
macc audio input get
macc audio input set "MacBook Pro Microphone"

Volume

Control system volume.

macc volume get                     # 0-100
macc volume set 50
macc volume up                      # +5 (default step)
macc volume up 10                   # +10
macc volume down                    # -5
macc volume down 10                 # -10
macc volume mute
macc volume unmute
macc volume toggle                  # Toggle mute

Display

Manage displays — resolution, primary display, and layout save/restore. Display names, UUIDs, and current modes are shown in the list.

macc display list                   # List all displays (name, ID, UUID, mode, position)

macc display mode list              # Available modes for all displays
macc display mode list <id>         # Available modes for a display
macc display mode list <id> --hidpi       # HiDPI modes only
macc display mode list <id> --no-hidpi    # Non-HiDPI modes only
macc display mode list <id> --hz 144      # 144Hz modes only
macc display mode list <id> --ratio 16:9  # 16:9 only (also 16:10, 4:3, 21:9, 32:9)
macc display mode list <id> --hidpi --hz 120 --ratio 16:9  # Combine filters
macc display mode get <id>          # Current mode
macc display mode set <id> 2560x1440
macc display mode set <id> 1920x1080 --hz 144
macc display mode set <id> 1920x1080 --hidpi  # Prefer HiDPI mode

macc display primary get            # Show current primary display
macc display primary set <id>       # Set primary (moves Dock & menu bar)

macc display layout get             # Print current layout (pipe-friendly)
macc display layout apply <entry>...  # Restore a saved layout

Display IDs accept numeric IDs, full UUIDs, or UUID prefixes:

macc display mode get 6
macc display mode get 1092              # UUID prefix (unambiguous)
macc display mode get 10921E9E-FC76-40F2-9E0E-E2DB6D3D3BEA

Sidecar, AirPlay, and other virtual displays are automatically identified by name.

Save and restore display layouts:

# Save
macc display layout get > ~/work.layout

# Restore
cat ~/work.layout | xargs macc display layout apply

IME

Switch keyboard input methods.

macc ime list                       # List input sources (* = current)
macc ime get                        # Current input source ID
macc ime set com.apple.keylayout.ABC
macc ime next                       # Cycle to next input source

Finder

Toggle Finder settings.

macc finder hidden on|off|toggle|get       # Hidden files
macc finder extensions on|off|toggle|get   # File extensions
macc finder pathbar on|off|toggle|get      # Path bar
macc finder statusbar on|off|toggle|get    # Status bar
macc finder desktop on|off|toggle|get      # Desktop icons
macc finder close                          # Close all Finder windows

Dock

Control Dock appearance and behavior.

macc dock hide on|off|toggle|get       # Auto-hide
macc dock position get|set left|bottom|right
macc dock size get|set <16-128>            # Icon size in pixels
macc dock mag on|off|toggle|get            # Magnification

Menu Bar

macc menubar hide on|off|toggle|get

Appearance

Control dark mode and accent color.

macc appearance get                 # "dark" or "light"
macc appearance dark                # Enable dark mode
macc appearance light               # Enable light mode
macc appearance toggle              # Toggle dark/light

macc appearance accent get          # Current accent color name
macc appearance accent set blue     # Set accent color
# Colors: multicolor, blue, purple, pink, red, orange, yellow, green, graphite

Bluetooth

Control Bluetooth power and manage paired devices.

macc bt power on|off|toggle|get
macc bt list                                 # List paired devices (* = connected)
macc bt connect "AirPods Pro"                # Connect by name (prefix match)
macc bt disconnect "AirPods Pro"

Project Structure

macc/
├── src/
│   ├── main.zig           # CLI app definition
│   ├── root.zig           # Business logic (macc module)
│   └── cmd/               # Command handlers
│       ├── audio.zig
│       ├── volume.zig
│       ├── display.zig
│       ├── ime.zig
│       ├── finder.zig
│       ├── dock.zig
│       ├── menubar.zig
│       ├── appearance.zig
│       └── bluetooth.zig
├── pkg/
│   ├── cli/               # Comptime CLI framework
│   └── macos/             # macOS framework bindings
│       └── src/
│           ├── coreaudio/
│           ├── corefoundation/
│           ├── coregraphics/
│           └── hitoolbox/
└── ref/                   # Reference implementations

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages