Skip to content

Instantly share code, notes, and snippets.

@jerlendds
Created October 14, 2025 12:17
Show Gist options
  • Select an option

  • Save jerlendds/bf9048a02db3068d6f22512d81d6a0de to your computer and use it in GitHub Desktop.

Select an option

Save jerlendds/bf9048a02db3068d6f22512d81d6a0de to your computer and use it in GitHub Desktop.
~/.codex/config.toml
#!/usr/bin/env python3
import json
import subprocess
import sys
def main() -> int:
if len(sys.argv) != 2:
print("Usage: notify.py <NOTIFICATION_JSON>")
return 1
try:
notification = json.loads(sys.argv[1])
except json.JSONDecodeError:
return 1
match notification_type := notification.get("type"):
case "agent-turn-complete":
assistant_message = notification.get("last-assistant-message")
if assistant_message:
title = f"Codex: {assistant_message}"
else:
title = "Codex: Turn Complete!"
input_messages = notification.get("input_messages", [])
message = " ".join(input_messages)
title += message
case _:
print(f"not sending a push notification for: {notification_type}")
return 0
subprocess.check_output(
[
"notify-send",
"--app-name",
"codex",
"--wait",
message
]
)
return 0
if __name__ == "__main__":
sys.exit(main())
model = "gpt-5-codex"
show_raw_agent_reasoning = true
approval_policy = "on-failure"
notify = ["python3", "/home/jerlendds/.local/bin/codex-notifier"]
show_raw_agent_reasoning = true
[model_providers.ollama]
name = "Ollama"
base_url = "http://localhost:11434/v1"
[history]
persistence = "save-all"
[tui]
notification = true
notifications = ["agent-turn-complete", "approval-requested"]
[tools]
web_search = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment