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

有没有什么软件可以把两个窗口粘起来

  •  1
     
  •   onsdriver · 17 天前 · 1607 次点击
    有没有什么软件可以把两个窗口粘起来,让它们被拖动的时候一起动

    第 1 条附言  ·  9 天前

    解决方案

    hammerspoon

    效果

    代码

    local function moveChatGPT()
        local targetFrame = hs.application.applicationsForBundleID("ru.keepcoder.Telegram")[1]:focusedWindow():frame()
        local gpt = hs.application.applicationsForBundleID("com.openai.chat")[1]:allWindows()[1]
        targetFrame.y = targetFrame.y + targetFrame.h
        targetFrame.h = targetFrame.h / 2
        gpt:setFrame(targetFrame)
    end
    
    local telegramWindowFilter = hs.window.filter.new(false):setAppFilter('Telegram')
    telegramWindowFilter:subscribe(hs.window.filter.windowMoved, moveChatGPT)
    
    10 条回复    2024-09-13 19:31:36 +08:00
    onsdriver
        1
    onsdriver  
    OP
       17 天前
    这个需求还是太怪了吗
    chenxuuu
        2
    chenxuuu  
       17 天前   ❤️ 1
    AquaSnap
    onsdriver
        3
    onsdriver  
    OP
       17 天前
    @chenxuuu 好像不支持 MacOS

    > AquaSnap is compatible with all Windows versions, from Windows 7 to Windows 11, with true 64-bit support. We will do our absolute best to support all future Windows versions.
    onsdriver
        4
    onsdriver  
    OP
       17 天前
    我去看看类似的软件,感谢!
    @chenxuuu
    onsdriver
        5
    onsdriver  
    OP
       16 天前
    没找到什么靠谱的替代啊,AquaSnap 真是完美符合我所有的需求,但是不支持 MacOS😭😭😭😭

    继续蹲,走过路过的朋友支支招
    chenxuuu
        6
    chenxuuu  
       16 天前
    如果是固定的几个软件,你用 hammerspoon 写个脚本就好了吧
    q534
        7
    q534  
       14 天前
    好怪,好爱,等一个方案
    onsdriver
        8
    onsdriver  
    OP
       9 天前
    已经使用 hammerspoon 解决,虽然不是很丝滑但也足矣!!

    效果:


    代码:
    ```lua
    local function moveChatGPT()
    local targetFrame = hs.application.applicationsForBundleID("ru.keepcoder.Telegram")[1]:focusedWindow():frame()
    local gpt = hs.application.applicationsForBundleID("com.openai.chat")[1]:allWindows()[1]
    targetFrame.y = targetFrame.y + targetFrame.h
    targetFrame.h = targetFrame.h / 2
    gpt:setFrame(targetFrame)
    end

    local telegramWindowFilter = hs.window.filter.new(false):setAppFilter('Telegram')
    telegramWindowFilter:subscribe(hs.window.filter.windowMoved, moveChatGPT)
    ```

    @q534 可以参考我的
    @chenxuuu 感谢指路
    rukeypei
        9
    rukeypei  
       8 天前
    想不到还有这个需求跟脚本
    onsdriver
        10
    onsdriver  
    OP
       6 天前
    @rukeypei 用户的需求千奇百怪,自定义脚本永远的神
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5558 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:53 · PVG 10:53 · LAX 19:53 · JFK 22:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.