是否有任何窗口管理器允许我将窗户捕捉到显示屏的侧面?
-
16-10-2019 - |
题
您可以推荐Mac的窗口管理器吗?我想拥有一个键盘快捷键,可以将窗户捕捉到我屏幕的左或右侧的窗户。
解决方案 3
测试尺寸和微风之后,我决定 微风 适合我的最佳需求。两者都允许您将窗户放在左,右或全屏上。为我出售的功能是为应用程序设置默认的大小和位置,并为其分配快捷键。
其他提示
sizeup 正是您需要的:
SizeUp允许您快速定位一个窗口,以精确地填充一半的屏幕(拆分),屏幕的四分之一(象限),全屏幕或通过菜单栏或可配置的系统范围的快捷方式(Hotkeys)中心。类似于其他操作系统上可用的“瓷砖窗口”功能。
分割
Divvy是一个小的Menubar应用程序,可让您自动调整任何活动窗口的大小。 Divviy实际上将您的屏幕分为6x6网格。当被调用时,Divvy用这个6x6网格在屏幕中间提出了一点HUD。根据要调整活动窗口大小的屏幕的哪一部分,只需拖动并选择HUD上的那些正方形,其余的窗口就会完成。这很简单。
如果您有魔术鼠标或魔术触控板, 更好的Touchtool 更好,因为您可以设置特定的手势来管理窗口。就像四指左滑动一样,可以调整屏幕左50%的窗口大小。
摩尔 是很棒的。您可以将窗口捕捉到:全屏,半屏幕,四分之一屏幕。您也可以通过网格调整大小。它也支持自定义键盘快捷键。
我个人每天都使用尺寸和分割。如果我早些时候知道Shiftit,我可能不会为SizeUp付费。尚未提及的另一个要检查的是 更好的Touchtool, ,它具有许多其他功能,但隐藏在高级选项中的是他们称之为“窗口捕捉”的不错的功能,当您将其拖动到侧面时,它将窗口捕捉到屏幕的左侧或右侧。不包含键盘快捷键功能,但它是尺寸和Divvy的不错补充。
我从这里发现 堆栈溢出上的主题问题:
那里提到的两个开源漫画没有出现在此列表中:
- 奇观 - > http://spectacleapp.com/
- 板岩 - > https://github.com/jigish/slate (设置需要在命令行上工作)
App Store的另一个
这是一个applescript,它将在最初的应用程序中铺上所有打开的窗口。添加 ~/Library/Scripts
并从菜单栏中的苹果菜单中调用。加盐以味道(和免费)。
--tile windows of frontmost applications in a grid
--this script is useful for
--multiple window chatting
--working side by side of several windows of the same app
--make need to make it as a stay open application later
--for now assume that it is opened and closed per invokation
property horizontalSpacing : 10 -- sets the horizontal spacing between windows
property verticalSpacing : 10 -- sets the vertical spacing between windows
property maxRows : 2
property maxCols : 2
on run {}
local a
set userscreen to my getUserScreen()
--display dialog (getFrntApp() as string)
try
set applist to getFrntApp()
if length of applist = 0 then
return
end if
set a to item 1 of getFrntApp()
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end try
try
tileScriptable(a, userscreen)
on error the error_message number the error_number
--display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
try
tileUnscriptable(a, userscreen)
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end try
end try
end run
on tileScriptable(a, screen)
local i, c
set i to 1
tell application named a
set theWindows to every window of application a whose visible is true and floating is false and ¬
modal is false -- and miniaturized is false
set c to count theWindows
if c = 0 then
return
end if
set tiles to calTileBounds(c, screen, 1)
repeat with theWindow in theWindows
my tileScriptableWindow(a, theWindow, item i of tiles)
set i to i + 1
end repeat
end tell
end tileScriptable
on tileUnscriptable(a, screeninfo)
-- unscriptable app
local i, c
set i to 1
tell application "System Events"
set theWindows to (every window of application process a)
--set theWindows to my filterUnscriptableInvisible(theWindows)
set c to count theWindows
if c = 0 then
return
end if
--display dialog screeninfo as string giving up after 5
set tiles to my calTileBounds(c, screeninfo, 1)
repeat with theWindow in theWindows
--display dialog (class of visible of theWindow)
my tileUnScriptableWindow(a, theWindow, item i of tiles)
set i to i + 1
end repeat
end tell
end tileUnscriptable
on filterUnscriptableInvisible(ws)
-- filter out from ws windows that are docked
set newws to {}
set docklist to getNamesDocked()
--display dialog (docklist as string)
repeat with theWindow in ws
if name of theWindow is not in docklist then
set end of newws to theWindow
end if
end repeat
--display dialog (count newws)
return newws
end filterUnscriptableInvisible
on getNamesDocked()
tell application "System Events" to tell process "Dock"'s list 1
set l to name of UI elements whose subrole is "AXMinimizedWindowDockItem"
end tell
return l
end getNamesDocked
on tileScriptableWindow(a, w, bound)
tell application a
set bounds of w to bound
end tell
end tileScriptableWindow
on tileUnScriptableWindow(a, w, bound)
tell application "System Events"
--display dialog (count position of w)
set AppleScript's text item delimiters to " "
set position of w to {(item 1 of bound), (item 2 of bound)}
-- why the -5?
set size of w to {(item 3 of bound) - (item 1 of bound) - 5, ¬
(item 4 of bound) - (item 2 of bound) - 5}
--display dialog (count properties of w)
end tell
end tileUnScriptableWindow
on calTileBounds(nWindows, screen, direction)
-- return a list of lists of window bounds
-- a simple tile algo that tiles along direction (current only 1=horizontal)
local nrows, nColumns, irow, icolumn, nSpacingWidth, nSpacingHeight, nWindowWidth, nWindowHeight
set {x0, y0, availScreenWidth, availScreenHeight} to screen
set ret to {}
set nrows to (nWindows div maxCols)
if (nWindows mod maxCols) ≠ 0 then
set nrows to nrows + 1
end if
if nrows < maxRows then
set nSpacingHeight to (nrows - 1) * verticalSpacing
set nWindowHeight to (availScreenHeight - nSpacingHeight) / nrows
else
set nSpacingHeight to (maxRows - 1) * verticalSpacing
set nWindowHeight to (availScreenHeight - nSpacingHeight) / maxRows
end if
repeat with irow from 0 to nrows - 1
if nrows ≤ maxRows and irow = nrows - 1 then
set nColumns to nWindows - irow * maxCols
else
set nColumns to maxCols
end if
set nSpacingWidth to (nColumns - 1) * horizontalSpacing
set nWindowWidth to (availScreenWidth - nSpacingWidth) / nColumns
set nTop to y0 + (irow mod maxRows) * (verticalSpacing + nWindowHeight)
--display dialog "Top: " & nTop buttons {"OK"} default button 1
repeat with icolumn from 0 to nColumns - 1
set nLeft to x0 + (icolumn) * (horizontalSpacing + nWindowWidth)
set itile to {¬
nLeft, ¬
nTop, ¬
nLeft + nWindowWidth, ¬
nTop + nWindowHeight}
set end of ret to itile
--display dialog item 3 of itile as string
--set itile to {x0 + (icolumn - 1) * wgrid, y0, wgrid, hgrid}
--set item 3 of itile to ((item 1 of itile) + (item 3 of itile))
--set item 4 of itile to ((item 2 of itile) + (item 4 of itile))
end repeat
end repeat
return ret
end calTileBounds
on getFrntApp()
tell application "System Events" to set frntProc to ¬
name of every process whose frontmost is true and visible ≠ false
return frntProc
end getFrntApp
on getUserScreen()
-- size of the menubar
tell application "System Events"
set {menuBarWidth, menuBarHeight} to size of UI element 1 of application process "SystemUIServer"
--display dialog "Menubar width: " & menubarWidth & ", height: " & menubarHeight
set dockApp to (application process "Dock")
set {dockWidth, dockHeight} to size of UI element 1 of dockApp
--display dialog "Dock width: " & dockWidth & ", height: " & dockHeight
set dockPos to position of UI element 1 of dockApp
--display dialog "Dock x: " & (item 1 of dockPos) & ", y: " & (item 2 of dockPos)
end tell
-- size of the full screen
(*
{word 3 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Width") as number, ¬
word 3 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Height") as number}
*)
tell application "Finder"
set screenSize to bounds of window of desktop
set screenWidth to item 3 of screenSize
set screenHeight to item 4 of screenSize
end tell
--display dialog "Screen width: " & screenWidth & ", height: " & screenHeight
-- by default, set the available screen size to the full screen size
set availableWidth to screenWidth
set availableHeight to screenHeight - menuBarHeight
set availableX to 0
set availableY to menuBarHeight
--determine the userscreen origin and size
-- case 0: hidden dock
-- if (item 1 of dockPos < 0 or item 1 of dockPos ≥ screenHeight) then
-- no need to change anything
-- end if
-- case 1: bottom dock
if ((item 2 of dockPos) + dockHeight = screenHeight) then
set availableHeight to availableHeight - dockHeight
end if
-- case 2: left dock
if (item 1 of dockPos = 0) then
set availableWidth to availableWidth - dockWidth
set availableX to dockWidth
end if
-- case 3: right dock
if ((item 1 of dockPos) + dockWidth = screenWidth) then
set availableWidth to availableWidth - dockWidth
end if
return {availableX, availableY, availableWidth, availableHeight}
end getUserScreen
从我所看到和听到的 肚带 是将Windows 7的窗口管理带到Mac OS X的好应用。
Mercurymover
您可能还会查看Mercurymover,它为您提供一系列键盘映射下的一系列窗口移动工具。我曾经在用小笔记本电脑屏幕上挣扎时经常使用它,并且您可以将其翻转到屏幕边缘等。它最近在地映射了您在普通Windows中获得的“移动”系统菜单功能'视窗'。
据我了解,您想 戳 屏幕边缘的窗口,使窗口的侧面直接在屏幕的边缘。现在可以在Macos Sierra(10.12)本地使用。
您需要做的就是将要定位的窗口(通过单击并拖动窗口的顶部)到您想要的侧面。您需要缓慢地执行此操作,否则它将无法使用。将窗口拖到边缘后,它会粘一段时间,这是您应该停止的时候。