├── .gitattributes ├── .gitignore ├── static ├── Icon.png ├── iconp.png └── Icon32.png ├── .editorconfig ├── .github └── workflows │ └── main.yml ├── index.css ├── license ├── readme.md ├── package.json └── index.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | /dist 4 | -------------------------------------------------------------------------------- /static/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florindumitru/chatgpt-desktop-tray/HEAD/static/Icon.png -------------------------------------------------------------------------------- /static/iconp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florindumitru/chatgpt-desktop-tray/HEAD/static/iconp.png -------------------------------------------------------------------------------- /static/Icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/florindumitru/chatgpt-desktop-tray/HEAD/static/Icon32.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: Node.js ${{ matrix.node-version }} 8 | runs-on: macos-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | node-version: 13 | - 14 14 | steps: 15 | - uses: actions/checkout@v2 16 | - uses: actions/setup-node@v2 17 | with: 18 | node-version: ${{ matrix.node-version }} 19 | - run: npm install -------------------------------------------------------------------------------- /index.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | padding: 0; 4 | margin: 0; 5 | background: transparent; 6 | } 7 | 8 | /* Use OS default fonts */ 9 | body { 10 | font-family: 11 | system-ui, 12 | -apple-system, 13 | 'Segoe UI', 14 | Roboto, 15 | Helvetica, 16 | Arial, 17 | sans-serif, 18 | 'Apple Color Emoji', 19 | 'Segoe UI Emoji'; 20 | text-rendering: optimizeLegibility; 21 | font-feature-settings: 'liga', 'clig', 'kern'; 22 | } 23 | 24 | header { 25 | position: absolute; 26 | width: 500px; 27 | height: 250px; 28 | top: 50%; 29 | left: 50%; 30 | margin-top: -125px; 31 | margin-left: -250px; 32 | text-align: center; 33 | } 34 | 35 | header h1 { 36 | font-size: 60px; 37 | font-weight: 200; 38 | margin: 0; 39 | padding: 0; 40 | opacity: 0.7; 41 | } 42 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Florin Dumitru 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # ChatGPT Desktop - Tray App 2 | 3 | This is a simple tray app for ChatGPT. Using this app you can easily access the ChatGPT from your system tray. 4 | 5 | ChatGPT Desktop - Tray App 6 | 7 | 8 | ## Install 9 | 10 | *macOS 10.13+, Linux, and Windows 7+ are supported (64-bit only).* 11 | 12 | **macOS** 13 | 14 | [**Download**](https://github.com/florindumitru/chatgpt-desktop-tray/releases/latest) the `.dmg` file. 15 | 16 | **Linux** 17 | 18 | [**Download**](https://github.com/florindumitru/chatgpt-desktop-tray/releases/latest) the `.AppImage` or `.deb` file. 19 | 20 | *The AppImage needs to be [made executable](http://discourse.appimage.org/t/how-to-make-an-appimage-executable/80) after download.* 21 | 22 | **Windows** 23 | 24 | [**Download**](https://github.com/florindumitru/chatgpt-desktop-tray/releases/latest) the `.exe` file. 25 | 26 | --- 27 | 28 | ## Dev 29 | 30 | Built with [Electron](https://electronjs.org). 31 | 32 | ### Run 33 | 34 | ```sh 35 | npm install 36 | npm start 37 | ``` 38 | 39 | ### Publish 40 | 41 | ```sh 42 | npm run release 43 | ``` 44 | 45 | After Travis finishes building your app, open the release draft it created and click "Publish". 46 | 47 | 48 | ## Contributing 49 | The ChatGPT Desktop App is open-source and contributions are welcome! If you'd like to contribute, please fork the repository and create a pull request with your changes. You can also report bugs and suggest new features by opening an issue on the repository. 50 | 51 | ## License 52 | The ChatGPT Desktop App is released under the MIT License. See the LICENSE file for details. 53 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chatgptx", 3 | "productName": "ChatGPTx", 4 | "version": "1.0.1", 5 | "description": "The best AI ever", 6 | "license": "MIT", 7 | "repository": "https://github.com/florindumitru/chatgpt-desktop-tray", 8 | "author": { 9 | "name": "Florin Dumitru", 10 | "email": "dumitru.florin@outlook.com", 11 | "url": "https://github.com/florindumitru/chatgpt-desktop-tray" 12 | }, 13 | "scripts": { 14 | "postinstall": "electron-builder install-app-deps", 15 | "lint": "xo", 16 | "test": "npm run lint", 17 | "start": "electron .", 18 | "pack": "electron-builder --dir", 19 | "dist": "electron-builder --macos --linux --windows", 20 | "release": "np" 21 | }, 22 | "dependencies": { 23 | "electron-context-menu": "^3.4.0", 24 | "electron-debug": "^3.2.0", 25 | "electron-store": "^8.1.0", 26 | "electron-traywindow-positioner": "^1.1.1", 27 | "electron-unhandled": "^4.0.1", 28 | "electron-updater": "^5.2.1", 29 | "electron-util": "^0.17.2" 30 | }, 31 | "devDependencies": { 32 | "electron": "^13.0.0", 33 | "electron-builder": "^23.3.3", 34 | "np": "^7.6.2", 35 | "xo": "^0.51.0" 36 | }, 37 | "xo": { 38 | "envs": [ 39 | "node", 40 | "browser" 41 | ], 42 | "rules": { 43 | "unicorn/prefer-module": "off" 44 | } 45 | }, 46 | "np": { 47 | "publish": false, 48 | "releaseDraft": false 49 | }, 50 | "build": { 51 | "appId": "com.qubevo.chatgptx", 52 | "mac": { 53 | "category": "public.app-category.social-networking", 54 | "darkModeSupport": true, 55 | "identity": "Apple Development: office@qubevo.com (BLJ66743QZ)" 56 | }, 57 | "dmg": { 58 | "iconSize": 160, 59 | "contents": [ 60 | { 61 | "x": 180, 62 | "y": 170 63 | }, 64 | { 65 | "x": 480, 66 | "y": 170, 67 | "type": "link", 68 | "path": "/Applications" 69 | } 70 | ] 71 | }, 72 | "linux": { 73 | "target": [ 74 | "AppImage", 75 | "deb" 76 | ], 77 | "category": "Network;Chat" 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const {app, BrowserWindow, Tray, Menu, shell} = require('electron'); 2 | const path = require('path'); 3 | const process = require('process'); 4 | const positioner = require('electron-traywindow-positioner'); 5 | 6 | let window = null; 7 | let tray = null; 8 | 9 | const showWindow = () => { 10 | positioner.position(window, tray.getBounds()); 11 | window.show(); 12 | }; 13 | 14 | const toggleWindow = () => { 15 | if (window.isVisible()) { 16 | return window.hide(); 17 | } 18 | 19 | return showWindow(); 20 | }; 21 | 22 | const createTray = () => { 23 | tray = new Tray(path.join(__dirname, 'static', 'Icon.png')); 24 | tray.on('click', () => { 25 | toggleWindow(); 26 | }); 27 | tray.on('right-click', () => { 28 | const contextMenu = Menu.buildFromTemplate([ 29 | { 30 | label: 'Github', 31 | type: 'normal', 32 | click() { 33 | shell.openExternal( 34 | 'https://github.com/florindumitru/chatgpt-desktop-tray', 35 | ); 36 | }, 37 | }, 38 | 39 | {type: 'separator'}, 40 | {label: 'Quit', type: 'normal', role: 'quit'}, 41 | ]); 42 | 43 | tray.popUpContextMenu(contextMenu); 44 | }); 45 | }; 46 | 47 | const createWindow = () => { 48 | // Create the browser window. 49 | window = new BrowserWindow({ 50 | width: 400, 51 | height: 600, 52 | show: false, 53 | frame: false, 54 | icon: path.join(__dirname, 'static', 'iconp.png'), 55 | webPreferences: { 56 | nodeIntegration: true, 57 | }, 58 | }); 59 | 60 | window.menuBarVisible = false; 61 | window.loadURL('https://chat.openai.com/chat'); 62 | window.setSkipTaskbar(true); 63 | if (process.platform === 'darwin') { 64 | app.dock.hide(); 65 | app.dock.setIcon(path.join(__dirname, 'static', 'iconp.png')); 66 | } 67 | }; 68 | 69 | app.on('ready', () => { 70 | createWindow(); 71 | createTray(); 72 | }); 73 | 74 | app.on('window-all-closed', () => { 75 | if (process.platform !== 'darwin') { 76 | app.quit(); 77 | } 78 | }); 79 | app.on('will-quit', () => { 80 | // GlobalShortcut.unregisterAll(); 81 | }); 82 | 83 | app.on('activate', () => { 84 | if (BrowserWindow.getAllWindows().length === 0) { 85 | createWindow(); 86 | } 87 | }); 88 | --------------------------------------------------------------------------------