macscreens

command module
v0.0.0-...-4d25832 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 9 Imported by: 0

README

macscreens

A tiny implementation to save and restore multi-monitor layout configs for Mac.

MVP

  • Save the current display configuration
  • Restore a display configuration
  • List all available configurations

Installation

Due to the dependency on the native CoreGraphic libraries on macOS, you'll need a few prerequisites on your system

Prerequisites
  • go>=1.16, you'll need a minimum of golang version 1.16
  • A macOS compatible system (Book Air, Book Pro, Studio Pro, Mini, etc)
Build
  • Clone this repository
$ git clone https://github.com/barelyhuman/macscreens.git macscreens
  • change the active directory to macscreens
$ cd macscreens
  • build and install it using go
$ go mod tidy; go build; go install

go mod tidy is optional since the binary has no dependencies right now in the MVP stage, we will have a few deps in the future for an aesthetic CLI.

Usage

Usage of macscreens:
  -apply NAME
    	apply the configuration with the name NAME
  -list
    	list all saved configurations
  -save NAME
    	Save the current configuration as NAME

--save

  1. Go into your display settings from System Preferences > Displays > Arrange and use the UI to define a layout for your Monitors
  2. In a terminal, you can now save this layout using macscreens
$ macscreens --save bottom-main-display
  1. This will now be saved in ~/.config/macscreens/bottom-main-display.json with the X and Y coordinates of each monitor.

--apply

  1. You can now restore any saved configuration directly from the terminal using
$ macscreens --apply bottom-main-display

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL