I've been using macOS for about 8 years and as a dual monitor user there was always a very annoying problem which I could never find a perfect solution for. Every time I connected or disconnected my second monitor from my MacBook, macOS messed up the window positions.
My configuration is a available at github and provides the following features:
Hardware event notifications
It's always good to know what is going on with your computer. Using this script you will get detailed notifications whenever there is a change in one of the monitored system components. Currently the following events are supported:
- USB connections
- Battery state
- WiFi connections
- Volume mount / unmount
You can define a layout for a specific application window. Whenever this application is started the window will be automatically moved and resized according to the configuration.
There are two different layout configurations.
dualLayout will be used if a second monitor is connected.
singleLayout will be used if only one monitor is connected.
The layout will be automatically changed when a monitor is connected or disconnected.
Bluetooth will be turned off when the second monitor is unplugged (blueutil must be installed). You can configure this feature with the
As a replacement for
growlnotify you can use the following command to display a notification:
open 'hammerspoon://notify?title=This is the title&subtitle=A subtitle&info=The info text'
To open a new browser window in a special developer mode, use this command:
This configuration is work in progress and there will be more features in the future.
git clone https://github.com/code2k/.hammerspoon.git ~/.hammerspoon cd ~/.hammerspoon cp example-config.lua config.lua
config.lua as needed.