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) Calculate the coordinates of the window frame in the next screen and retain aspect ratio Local windowFrame = focusedWindow:frame() Local nextScreenFrame = focusedWindow:screen():next():frame() They allow you to switch to any window with only two keystrokes: One shortcut to bring up icons and letters for every window, and then simply hitting the key corresponding to the window you want. Solved Reuse Cmd+Tab for hammerspoon application switcher. New posts New profile posts Latest activity. Local focusedScreenFrame = focusedWindow:screen():frame() The first Hammerspoon module I wrote was a port of Slate’s window hints, which if you’ve ever used Vimium or Vimperator, are like link hints for windows. Stefan Asks: Reuse Cmd+Tab for hammerspoon application switcher I set up hammerspoon and use hs.window.switcher as mentioned in the docs. 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 |