onsdriver
V2EX  ›  macOS

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

  •  1
     
  •   onsdriver · Sep 2, 2024 · 3336 views
    This topic created in 812 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
    onsdriver
    OP
    Sep 2, 2024
    1
    这个需求还是太怪了吗
    chenxuuu
    chenxuuu
    Sep 2, 2024❤️1
    2
    AquaSnap
    onsdriver
    onsdriver
    OP
    Sep 2, 2024
    3
    @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
    onsdriver
    OP
    Sep 2, 2024
    4
    我去看看类似的软件,感谢!
    @chenxuuu
    onsdriver
    onsdriver
    OP
    Sep 4, 2024
    5
    没找到什么靠谱的替代啊,AquaSnap 真是完美符合我所有的需求,但是不支持 MacOS😭😭😭😭

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