千问办公图标替换
Use the packaged asset and deterministic script. Do not use Computer Use, Finder UI automation, or direct replacement of Contents/Resources/icon.icns.
Materialize bundled image assets
The bundled icon images ship as Base64 text (assets/*.txt) because the skill package cannot contain binary files. Before any step that needs a concrete .png path, materialize them by running:
python3 scripts/materialize-assets.py
This decodes assets/*.txt into real assets/*.png. After materializing, the referenced .png paths below become valid. To uninstall them, run python3 scripts/materialize-assets.py --clean.
Materialize once at the start of the skill; every .png reference below assumes it has run.
User-visible image presentation
Whenever this skill says to present, display, or preview an image, make the image visible to the user as a chat attachment or file card. Merely reading the image for model inspection does not satisfy this requirement.
- In 千问办公, resolve the image to an absolute path and call
qwenwork_file_present_fileswith that path. - On another host, use its equivalent user-visible file-presentation or attachment tool.
- If no such tool exists, print the absolute path and explicitly tell the user that the current host cannot render it inline. Do not claim that the image was displayed.
Required interaction
Before changing the app:
-
Materialize the bundled assets: run
python3 scripts/materialize-assets.py. Confirmassets/built-in-icon-gallery.png,assets/precision-orbit-dark.png, andassets/precision-orbit-light.pngnow exist. -
Resolve the target application path:
- First check/Applications/QwenWorkCN.app.
- If it is missing, ask the user for the full path to the official 千问办公.appbundle. Tell them how to obtain it: open Finder, locate 千问办公, select it, press⌥⌘C(Copy as Pathname), then paste the result into the chat. As an alternative, they may drag the app from Finder into a Terminal window and copy the displayed path.
- Do not continue until a path is available. Runscripts/qwen-icon.sh status --app <provided-path>to verify that it exists and has bundle identifiercn.qwenwork.desktop.mac. If verification fails, explain the exact problem and ask for the correct 千问办公 app path. - Resolve and present only
assets/built-in-icon-gallery.pngas a user-visible chat card. In 千问办公, callqwenwork_file_present_fileswith its absolute path. AReadresult alone is insufficient. Do not separately present either individual built-in icon file. - Ask the user to choose one built-in option or a custom icon:
-1Precision Orbit, dark:assets/precision-orbit-dark.png
-2Precision Orbit, light:assets/precision-orbit-light.png
- Custom icon - Do not mutate the app before the user chooses.
Custom icon submission
Before asking the user to upload a custom icon, state all requirements:
- PNG or ICNS file;
- square canvas, at least 512×512 and preferably 1024×1024;
- a genuine Alpha channel with all four canvas corners transparent;
- no baked checkerboard, white rectangle, black rectangle, watermark, or surrounding screenshot;
- visible icon body centered and occupying roughly 70%–85% of the canvas, leaving transparent padding;
- no important artwork or shadow touching the canvas edge.
After receiving the file:
- Materialize attachments as a local file.
- Immediately run the following two validation stages in order, without asking whether to continue between them:
- Run
scripts/check-icon.sh <path>for format, dimensions, square ratio, and Alpha. - If the file can be decoded, inspect it yourself and also present it to the user using the user-visible image-presentation convention above. In 千问办公, call
qwenwork_file_present_fileswith its absolute path;Readalone is insufficient. Check transparent corners, absence of a baked background/checkerboard, centered artwork, and approximately 70%–85% visual occupancy. - Never pause after the script check to ask whether the user wants the visual review. Perform both stages automatically whenever the image is readable. If the first stage proves the file cannot be decoded, report that failure because visual review is impossible.
- If any check fails, list the exact failed requirements and give a concrete correction, then wait for a replacement file. Do not apply or silently repair the icon unless the user separately asks for repair.
- Apply only after both the script and visual review pass.
Treat the user's explicit built-in/custom choice as authorization to replace the current custom icon. Do not ask again unless the target app or icon changes.
Apply the choice
Resolve the skill directory containing this file, then run:
python3 scripts/materialize-assets.py
scripts/qwen-icon.sh apply --app <resolved-app-path> --icon <chosen-local-image> --replace-existing
For a built-in choice, use its mapped asset path above. Every packaged option is a 1024×1024 RGBA image with transparent canvas corners and a centered icon body occupying about 80% of the canvas. Preserve those properties when updating the assets.
The script only accepts the official bundle identifier cn.qwenwork.desktop.mac. /Applications/QwenWorkCN.app is only the initial default; always use the verified user-provided path when the app is installed elsewhere. The script uses the public AppKit custom-icon API, leaves Contents/ and the bundled icon.icns unchanged, and writes reversible custom-icon data at the outer .app level.
If the command reports macOS App Management denial, stop. Tell the user to grant the calling AI app or terminal permission under System Settings → Privacy & Security → App Management, then rerun after they confirm. Do not fall back to Computer Use, sudo, ad-hoc re-signing, or editing signed resources.
After applying, report:
- which icon was selected;
- whether normal code-signature verification succeeded;
- the Gatekeeper assessment;
- that app updates may reset the custom icon.
If the Dock still shows a cached icon, ask before restarting Dock; after approval, killall Dock is sufficient.
Restore
When the user asks to restore the vendor icon, run:
scripts/qwen-icon.sh restore --app <resolved-app-path>
This removes only the custom icon and exposes the original bundled icon again.
Boundaries
- Never modify a different application, even if the user supplies another path, unless they explicitly ask to broaden the skill.
- Never replace
Contents/Resources/icon.icns, editInfo.plist, or re-sign the application. - Do not claim the bundle is byte-for-byte untouched: macOS stores the custom icon as outer bundle metadata and may create an
Iconfile whose final character is a carriage return. - Use ordinary
codesign --verify --deep, not--strict; strict packaging validation rejects Finder custom-icon metadata even when Gatekeeper still accepts the notarized app.