Is there a way in code to find out if the Dock on a Mac is located on the bottom, left, or right side of the user's monitor?
NSScreen
has visibleFrame
method, wich returns a rect that doesn't include the area currently occupied by the dock and menu bar. You can compare this rect with the full screen rect(- (NSRect) [NSScreen* frame]
) and determine the dock location.
This is probably simpler…
defaults read com.apple.dock "orientation"
bottom
You can also find out.. autohide
(i.e. 1), large size
(i.e. "65.48148") and magnification
(i.e. 1), etc.
private discovered API used by prefs panel
typedef enum {
kCoreDockOrientationTop = 1,
kCoreDockOrientationBottom = 2,
kCoreDockOrientationLeft = 3,
kCoreDockOrientationRight = 4
} CoreDockOrientation;
extern void CoreDockGetOrientationAndPinning(CoreDockOrientation *outOrientation, CoreDockPinning *outPinning);
// If you only want to set one, use 0 for the other.
extern void CoreDockSetOrientationAndPinning(CoreDockOrientation orientation, CoreDockPinning pinning);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With