V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
pheyer
V2EX  ›  macOS

Mac 下这么多窗口管理 app 有居中半屏的功能却比较少见

  •  
  •   pheyer · 2018-07-10 14:53:29 +08:00 · 3093 次点击
    这是一个创建于 2106 天前的主题,其中的信息可能已经有所发展或是发生改变。

    现在几乎都是用宽屏了吧,有些编辑器全屏显示时在最左边显示很是别扭,想要一个居中半屏显示功能发现 BetterTouchTool 居然没有这个 action,也没找到自定义入口,其它 app 也没见到有

    后来是在别人的 HammerSpoon 配置基础上简要修改了一下自定义实现了

    假设你没用过 HammerSpoon,以下是步骤:

    1. 安装 HammerSpoon
    2. clone 这个 repo 到本地: https://github.com/S1ngS1ng/HammerSpoon
    3. 复制里面的 init.lua, key-binding.lua, vim-binding.lua, vox-control.lua, window-management.lua 文件到~/..hammerspoon 文件夹中,注意会替换里面的 init.lua ,有需要记得备份
    4. window-management.lua 中增加 一个 lua 函数: module.centerHalf = function () local this = windowMeta.new() local cell = Cell(0.25 * this.screenGrid.w, 0, 0.5 * this.screenGrid.w, this.screenGrid.h) grid.set(this.window, cell, this.screen) end

    然后在 key-binding.lua 文件中增加对应的快捷键调用即可

    其它的快捷键功能根据需要可以裁剪,如果只是快捷键控制。这个配置还挺全的,基本上可以替代 BetterTouchTool 里面的窗口管理功能了,还免费

    原链: HammerSpoon - 不止是窗口管理 | S1ngS1ng

    9 条回复    2018-07-11 13:02:48 +08:00
    mcfog
        1
    mcfog  
       2018-07-10 14:58:51 +08:00
    window tidy / mosaic
    applepieuser
        2
    applepieuser  
       2018-07-10 16:06:44 +08:00
    是你见识太少。moom 和 mosaic 预设和自定义都有。
    litp
        3
    litp  
       2018-07-10 16:58:40 +08:00
    一脸懵逼进来 。。
    lightening
        4
    lightening  
       2018-07-10 16:59:38 +08:00
    用 Slate 自己写个绑定就行。它是用 JavaScript 设置的。
    pheyer
        5
    pheyer  
    OP
       2018-07-10 17:43:34 +08:00
    @applepieuser 的确是没用过
    unidentifiedme
        6
    unidentifiedme  
       2018-07-10 19:32:14 +08:00
    什么叫居中半屏显示,是说 Windows+Left Arrow 么?
    如果是的话,几乎每一个都有好吧,Moom 是肯定有的。
    bao3
        7
    bao3  
       2018-07-11 01:46:02 +08:00 via iPhone
    magnet 也行,类似软件一抓一把
    tsui
        8
    tsui  
       2018-07-11 04:13:31 +08:00
    99 分买个 magnet,居中 1/2,1/3 都可以
    之前用的两个似乎也都有。。。
    20015jjw
        9
    20015jjw  
       2018-07-11 13:02:48 +08:00 via Android
    我怎么感觉这类 app 都有..
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5487 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:51 · PVG 14:51 · LAX 23:51 · JFK 02:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.