简单的将chatgpt包装成桌面应用的方式
chrome的app mode可以在一个独立的窗口启动单个网页,我利用这个特性加上下面的autohotkey脚本启动chatgpt和gemini,然后再用快捷键去访问独立的窗口,就可以像一个app一样显示单独的网页。
monitor := 1 ;;----------------- left -------------------- Run, chrome.exe --app="https://chat.openai.com" WinWaitActive, ChatGPT SysGet, Monitor, Monitor, %monitor% mx := MonitorLeft my := MonitorTop long := (MonitorRight - MonitorLeft) / 2 width := MonitorBottom - MonitorTop WinMove, A,, mx,my, long, width release_focus() ;;----------------- right -------------------- Run, chrome.exe --app="https://gemini.google.com/app" WinWaitActive, Gemini SysGet, Monitor, Monitor, %monitor% mx := (MonitorRight - MonitorLeft) / 2 + MonitorLeft my := MonitorTop long := (MonitorRight - MonitorLeft) / 2 width := MonitorBottom - MonitorTop WinMove, A,, mx,my, long, width release_focus() ;;----------------- release_focus -------------------- release_focus() { hwnd := DllCall("GetDesktopWindow") DllCall("SetForegroundWindow", "UInt", hwnd) }
然后用autohotkey设置快捷键去选择,当按下 Alt+Ctrl+a 的时候就像按一个开关, 按一下显示两个窗口,再按一下最小化两个窗口。这样就像本地应用一样,可以通过快捷键去选择应用然后使用了。
<^!a:: ;;min SetTitleMatchMode, 3 IfWinActive, Gemini { WinGetTitle, currentWindow, A WinMinimize Gemini WinMinimize ChatGPT WinActivate, currentWindow SetTitleMatchMode, 1 return } IfWinActive, ChatGPT { WinGetTitle, currentWindow, A WinMinimize Gemini WinMinimize ChatGPT WinActivate, currentWindow SetTitleMatchMode, 1 return } ;;gemini if WinExist("Gemini") WinActivate else MsgBox, Gemini not exist. ;;chatgpt if WinExist("ChatGPT") WinActivate else MsgBox, ChatGPT not exist. SetTitleMatchMode, 1 return
具体效果如下: