V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
onsdriver
V2EX  ›  macOS

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

  •  1
     
  •   onsdriver · Sep 2, 2024 · 2677 views
    This topic created in 607 days ago, the information mentioned may be changed or developed.
    有没有什么软件可以把两个窗口粘起来,让它们被拖动的时候一起动

    Supplement 1  ·  Sep 10, 2024

    解决方案

    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 replies    2024-09-13 19:31:36 +08:00
    onsdriver
        1
    onsdriver  
    OP
       Sep 2, 2024
    这个需求还是太怪了吗
    chenxuuu
        2
    chenxuuu  
       Sep 2, 2024   ❤️ 1
    AquaSnap
    onsdriver
        3
    onsdriver  
    OP
       Sep 2, 2024
    @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
       Sep 2, 2024
    我去看看类似的软件,感谢!
    @chenxuuu
    onsdriver
        5
    onsdriver  
    OP
       Sep 4, 2024
    没找到什么靠谱的替代啊,AquaSnap 真是完美符合我所有的需求,但是不支持 MacOS😭😭😭😭

    继续蹲,走过路过的朋友支支招
    chenxuuu
        6
    chenxuuu  
       Sep 4, 2024
    如果是固定的几个软件,你用 hammerspoon 写个脚本就好了吧
    q534
        7
    q534  
       Sep 5, 2024
    好怪,好爱,等一个方案
    onsdriver
        8
    onsdriver  
    OP
       Sep 10, 2024
    已经使用 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  
       Sep 11, 2024
    想不到还有这个需求跟脚本
    onsdriver
        10
    onsdriver  
    OP
       Sep 13, 2024
    @rukeypei 用户的需求千奇百怪,自定义脚本永远的神
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2565 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 12:54 · PVG 20:54 · LAX 05:54 · JFK 08:54
    ♥ Do have faith in what you're doing.