Skip to main content

Vertical and Horizontal position

You can choose where the window will appear on the screen when using the "Simple" value for the OnScreen key. To do so, you have to add the Position dictionary in the Window section. This Position dictionary requires two keys: the Horizontal position key and the Vertical position key. As you might imagine, the Horizontal key can take a value among "Left", "Center", and "Right" and the Vertical: "Top", "Center", "Bottom". An optional Padding key can be specified to add padding from the screen with the Padding number key. For example, to position the application window on the top right of the screen, you can write the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Window</key>
<dict>
<key>OnScreen</key>
<string>Simple</string>
<key>Position</key>
<dict>
<key>Horizontal</key>
<string>Right</string>
<key>Vertical</key>
<string>Top</string>
</dict>
</dict>
</dict>

Now if you want to center the application window and add a 20 points padding, you would write:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Window</key>
<dict>
<key>OnScreen</key>
<string>Simple</string>
<key>Position</key>
<dict>
<key>Horizontal</key>
<string>Center</string>
<key>Vertical</key>
<string>Center</string>
<key>Padding</key>
<real>20</real>
</dict>
</dict>
</dict>

Specify the screen

In case you or your end users have multiple screens, you can scpecify the screen on which the window should appear with the ScreenIndex key. With our last example, this would give

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Window</key>
<dict>
<key>OnScreen</key>
<string>Simple</string>
<key>Position</key>
<dict>
<key>Horizontal</key>
<string>Center</string>
<key>Vertical</key>
<string>Center</string>
<key>Padding</key>
<real>20</real>
</dict>
<key>ScreenIndex</key>
<integer>2</integer>
</dict>
</dict>

To know which screen corresponds to which index, you can use the brightness tool and identify your screens by their resolution.

> brew install brightness
brightness -lv

Discover more

You can checkout the Onboarding demo configuration to see how the window position is specified.