Skip to content

Instantly share code, notes, and snippets.

@jcheng31
jcheng31 / Marginator.ahk
Last active February 20, 2024 23:45
An AutoHotkey script for widescreen, high-resolution monitors. Resizes the active window to be 75% of the screen's width (and 100% of its height, taskbar excluded) and centres it. Triggered by pressing Win+Shift+Up. Great for websites that don't nicely centre their content. Win+Shift+C now centres the active window without resizing it.
; When Win+Shift+Up is pressed, resize the active window to be 75% of the screen width
; and centre it. Useful for widescreen resolutions >= 1080p, but uses the resolution
; of the primary monitor.
#+Up::
SysGet, BoundingCoordinates, MonitorWorkArea
ResolutionWidth := BoundingCoordinatesRight - BoundingCoordinatesLeft
ResolutionHeight := BoundingCoordinatesBottom - BoundingCoordinatesTop