Skip to content

Advanced Usage: Configuration and Optimization

This chapter helps you master opencode-notify's advanced features, understand configuration options in depth, optimize notification experience, and customize notification behavior based on personal needs.

Learning Path

Follow this sequence to learn the content in this chapter:

1. Configuration Reference

Get a comprehensive understanding of all available configuration options and their purposes.

  • Master configuration file structure and syntax
  • Learn notification sound customization methods
  • Understand sub-session notification toggle use cases
  • Learn terminal type override configuration methods

2. Quiet Hours Explained

Learn how to set up quiet hours to avoid interruptions during specific times.

  • Configure quiet hours start and end times
  • Handle overnight quiet hours (e.g., 22:00 - 08:00)
  • Temporarily disable quiet hours when needed
  • Understand priority of quiet hours vs other filtering rules

3. Terminal Detection Principles

Deep dive into the working mechanism of automatic terminal detection.

  • Learn how the plugin identifies 37+ terminal emulators
  • Understand macOS platform focus detection implementation
  • Master manual terminal type specification methods
  • Understand default behavior when detection fails

4. Advanced Usage

Master configuration techniques and best practices.

  • Configuration strategies to avoid notification spam
  • Adjust notification behavior based on workflow
  • Configuration recommendations for multi-window and multi-terminal environments
  • Performance optimization and troubleshooting techniques

Prerequisites

Before starting this chapter, it's recommended to complete the following basics:

  • Quick Start: Complete plugin installation and basic configuration
  • How It Works: Understand the plugin's core functionality and event listening mechanisms
  • Platform Features (Optional): Learn about platform-specific features

Learning Tips

If you just want to customize notification sounds or set up quiet hours, you can jump directly to the corresponding sub-pages. If you encounter problems, you can always refer to the configuration reference chapter.

Next Steps

After completing this chapter, you can continue exploring:


Click to expand source code locations

Updated: 2026-01-27

FeatureFile PathLines
Configuration Interface Definitionsrc/notify.ts30-48
Default Configurationsrc/notify.ts56-68
Configuration Loadingsrc/notify.ts90-114
Quiet Hours Checksrc/notify.ts181-199
Terminal Detectionsrc/notify.ts145-176
Terminal Process Name Mappingsrc/notify.ts71-84

Key Interfaces:

  • NotifyConfig: Configuration interface containing all configurable items
  • quietHours: Quiet hours configuration (enabled/start/end)
  • sounds: Sound configuration (idle/error/permission)
  • terminal: Terminal type override (optional)

Key Constants:

  • DEFAULT_CONFIG: Default values for all configuration items
  • TERMINAL_PROCESS_NAMES: Mapping table of terminal names to macOS process names