花1分钟给codex 插件加一个完成提示音
cat > ~/.codex/notify.py <<\’EOF\’\n#!/usr/bin/env python3\n\”\”\”\nCodex 通知脚本:Agent 回合完成时播放提示音 + 弹出 macOS 条幅通知。\n\”\”\”\n \nimport json\nimport os\nimport subprocess\nimport sys\n \ndef main() -> int:\nif len(sys.argv) != 2:\nreturn 0\n \ntry:\nevent = json.loads(sys.argv[1])\nexcept Exception:\nevent = {}\n \nif event.get(\”type\”) != \”agent-turn-complete\”:\nreturn 0\n \n# 1. 播放系统提示音(找不到就用 TTS)\nsound_path = \”/System/Library/Sounds/Glass.aiff\”\ntry:\nif os.path.exists(sound_path):\nsubprocess.Popen([\”afplay\”, sound_path])\nelse:\nsubprocess.Popen([\”say\”, \”Codex turn complete\”])\nexcept Exception:\npass\n \n# 2. 弹出 macOS Notification\ntry:\nsubprocess.Popen([\n\”osascript\”,\n\”-e\”,\n\’display notification \”Codex 回合已完成\” \’\n\’with title \”Codex\” subtitle \”Agent turn complete\”\’\n])\nexcept Exception:\npass\n \nreturn 0\n \nif __name__ == \”__main__\”:\nraise SystemExit(main())\nEOF