Skip to content

DeanHH/IntelMacCodexClaudeAppWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Electron App Performance Wrapper for macOS

A Python script that creates lightweight .app wrappers for Electron-based macOS(Intel) applications (e.g. Codex, Claude), injecting Chromium flags to fix UI rendering issues and improve performance.

Problem

Codex and Claude desktop apps on macOS may exhibit:

UI Display Issues:

  • Text rendering artifacts or blurry fonts
  • UI elements not displaying correctly (missing buttons, broken layouts)
  • Visual glitches during window resizing
  • Incorrect color rendering or transparency issues

Performance Issues:

  • Laggy or janky UI animations
  • High CPU usage during scrolling or window resizing
  • Sluggish text rendering in chat interfaces
  • GPU not being fully utilized (falling back to software rendering)

These issues stem from Electron/Chromium's default rendering settings not being optimized for macOS, particularly on Macs with multiple GPUs or high-DPI displays.

Solution

This script creates a standalone wrapper app (e.g. Codex Pro.app) that launches the original app with the following Chromium flags:

Flag Effect
--force-prefers-reduced-motion Reduces unnecessary CSS animations, lowering CPU/GPU load
--force_high_performance_gpu Forces the discrete GPU on dual-GPU Macs
--enable-gpu-rasterization Offloads page rasterization to GPU instead of CPU

The wrapper is a separate .app — it does not modify the original application, so updates won't break anything.

Usage

python3 create_electron_wrapper.py <AppName>

Examples:

python3 create_electron_wrapper.py Codex
python3 create_electron_wrapper.py Claude
python3 create_electron_wrapper.py Cursor

This creates /Applications/<AppName> Pro.app. Drag it to your Dock and use it instead of the original icon.

Requirements

  • macOS
  • Python 3.6+
  • Target app installed in /Applications/

macOS Electron 应用性能优化 Wrapper

一个 Python 脚本,为 macOS (intel芯片) 上的 Electron 应用(如 Codex、Claude)创建轻量 .app wrapper,注入 Chromium 启动参数以修复 UI 渲染问题并提升性能。

问题

Codex 和 Claude 桌面应用在 macOS 上可能出现:

UI 显示异常:

  • 文字渲染异常或字体模糊
  • UI 元素显示不正确(按钮缺失、布局错乱)
  • 调整窗口大小时出现视觉闪烁
  • 颜色渲染或透明度异常

性能问题:

  • UI 动画卡顿
  • 滚动或调整窗口大小时 CPU 占用过高
  • 聊天界面文字渲染迟缓
  • GPU 未被充分利用(回退到软件渲染)

根本原因是 Electron/Chromium 的默认渲染配置未针对 macOS 优化,在多 GPU 或高分辨率屏幕的 Mac 上尤为明显。

解决方案

脚本会创建一个独立的 wrapper 应用(如 Codex Pro.app),在启动原应用时自动注入以下 Chromium 参数:

参数 作用
--force-prefers-reduced-motion 减少不必要的 CSS 动画,降低 CPU/GPU 负载
--force_high_performance_gpu 在双 GPU 的 Mac 上强制使用独立显卡
--enable-gpu-rasterization 将页面光栅化从 CPU 转移到 GPU

Wrapper 是独立的 .app,不会修改原应用,应用更新不受影响。

使用方法

python3 create_electron_wrapper.py <应用名称>

示例:

python3 create_electron_wrapper.py Codex
python3 create_electron_wrapper.py Claude
python3 create_electron_wrapper.py Cursor

生成的 /Applications/<应用名> Pro.app 拖到 Dock 上即可使用。

环境要求

  • macOS
  • Python 3.6+
  • 目标应用已安装在 /Applications/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages