gpt4 book ai didi

hammerspoon - 如何在 Hammerspoon 的监视器之间移动应用程序?

转载 作者:行者123 更新时间:2023-12-03 15:09:25 27 4
gpt4 key购买 nike

在工作中,我有一个 3 显示器设置。我想通过键绑定(bind)将当前应用程序移动到第二个或第三个监视器。怎么做?

最佳答案

我使用以下脚本在屏幕中循环聚焦窗口。

-- bind hotkey
hs.hotkey.bind({'alt', 'ctrl', 'cmd'}, 'n', function()
-- get the focused window
local win = hs.window.focusedWindow()
-- get the screen where the focused window is displayed, a.k.a. current screen
local screen = win:screen()
-- compute the unitRect of the focused window relative to the current screen
-- and move the window to the next screen setting the same unitRect
win:move(win:frame():toUnitRect(screen:frame()), screen:next(), true, 0)
end)

关于hammerspoon - 如何在 Hammerspoon 的监视器之间移动应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54151343/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com