![]() Wrapping the snippet above in a function and binding it to a hotkey should cycle the currently focused application across your different monitors. Set the focused window's new frame dimensions WindowFrame.w = ((windowFrame.w / focusedScreenFrame.w) * nextScreenFrame.w) WindowFrame.h = ((windowFrame.h / focusedScreenFrame.h) * nextScreenFrame.h) WindowFrame.y = ((((windowFrame.y - focusedScreenFrame.y) / focusedScreenFrame.h) * nextScreenFrame.h) + nextScreenFrame.y) ![]() ![]() WindowFrame.x = ((((windowFrame.x - focusedScreenFrame.x) / focusedScreenFrame.w) * nextScreenFrame.w) + nextScreenFrame.x) runningApplications ()) do: local bundleID app: bundleID if bundleID nil then goto continue end: local path app: path ()-Strip out apps we dont want to pick from: if path nil then goto continue end: if string. Fast hyperlinking We used JIRA at Dropbox, and I always preferred to have JIRA issue identifiers actually be links to the issue when possible. Calculate the coordinates of the window frame in the next screen and retain aspect ratio Trigger alias nagscreen'hs -A -c 'nagScreen ()'' This uses the Hammerspoon CLI hs to call the function when the alias is run. Local windowFrame = focusedWindow:frame() Local nextScreenFrame = focusedWindow:screen():next():frame() Local focusedScreenFrame = focusedWindow:screen():frame() Local focusedWindow = hs.window.focusedWindow() and the next screen's frame dimensions. The Hammerspoon API doesn't provide an explicit function for doing this, so you gotta roll out with a custom implementation to achieve this: - Get the focused window, its window frame dimensions, its screen frame dimensions, I've answered this in Reddit post here, but in case anyone comes across this question here's the answer:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |