Skip to content

Commit

Permalink
[displays] factor in dock size
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallen23 committed May 3, 2013
1 parent f2840cf commit c5de9b7
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion lib/displays.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,28 @@ on getDisplayBounds()
tell application "Finder"
set scrRes to bounds of window of desktop
end tell
tell application "System Events"
tell dock preferences
set dockProperties to get properties
end tell

if autohide of dockProperties is false then
tell process "Dock"
set dockDimensions to size in list 1
set dockWidth to item 1 of dockDimensions
set dockHeight to item 2 of dockDimensions
end tell
set screenEdge to screen edge of dockProperties
if screenEdge is bottom then
set item 4 of scrRes to (item 4 of scrRes) - dockHeight
else if screenEdge is left then
set item 1 of scrRes to dockWidth
set item 4 of scrRes to (item 4 of scrRes) - dockWidth
else if screenEdge is right then
set item 3 of scrRes to (item 3 of scrRes) - dockWidth
end if
end if
end tell

return scrRes
end getDisplays
end getDisplayBounds

0 comments on commit c5de9b7

Please sign in to comment.