Skip to content

Instantly share code, notes, and snippets.

@jerlendds
Created October 14, 2025 12:17
Show Gist options
  • Save jerlendds/bf9048a02db3068d6f22512d81d6a0de to your computer and use it in GitHub Desktop.
Save jerlendds/bf9048a02db3068d6f22512d81d6a0de to your computer and use it in GitHub Desktop.

Revisions

  1. jerlendds created this gist Oct 14, 2025.
    46 changes: 46 additions & 0 deletions codex-notifier
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    #!/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())
    19 changes: 19 additions & 0 deletions config.toml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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