Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Create `~/.config/opencode/opencode-notifier.json` with the defaults:
"bell": false,
"timeout": 5,
"showProjectName": true,
"showFullPath": false,
"showSessionTitle": false,
"showIcon": true,
"customIconPath": null,
Expand Down Expand Up @@ -145,6 +146,7 @@ Create `~/.config/opencode/opencode-notifier.json` with the defaults:
"bell": false,
"timeout": 5,
"showProjectName": true,
"showFullPath": false,
"showSessionTitle": false,
"showIcon": true,
"suppressWhenFocused": true,
Expand All @@ -158,6 +160,7 @@ Create `~/.config/opencode/opencode-notifier.json` with the defaults:
- `bell` - Emit terminal BEL (`\x07`) on events (default: false). Behavior depends on your terminal/WM settings
- `timeout` - How long notifications show in seconds, Linux only (default: 5)
- `showProjectName` - Show folder name in notification title (default: true)
- `showFullPath` - Show full absolute path instead of folder name in notification title and `{projectName}` token (default: false). When true, shows `OpenCode (/home/user/projects/myapp)` instead of `OpenCode (myapp)`
- `showSessionTitle` - Include the session title in notification messages via `{sessionTitle}` placeholder (default: false)
- `showIcon` - Show OpenCode icon, Windows/Linux only (default: true)
- `customIconPath` - Path to a custom icon for notifications. Useful on WSL where Windows paths are needed (default: null)
Expand Down
1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface NotifierConfig {
bell: boolean
timeout: number
showProjectName: boolean
showFullPath: boolean
showSessionTitle: boolean
showIcon: boolean
customIconPath: string | null
Expand Down Expand Up @@ -125,6 +126,7 @@ const DEFAULT_CONFIG: NotifierConfig = {
bell: false,
timeout: 5,
showProjectName: true,
showFullPath: false,
showSessionTitle: false,
showIcon: true,
customIconPath: null,
Expand Down Expand Up @@ -290,6 +292,7 @@ export function loadConfig(): NotifierConfig {
? userConfig.timeout
: DEFAULT_CONFIG.timeout,
showProjectName: userConfig.showProjectName ?? DEFAULT_CONFIG.showProjectName,
showFullPath: userConfig.showFullPath ?? DEFAULT_CONFIG.showFullPath,
showSessionTitle: userConfig.showSessionTitle ?? DEFAULT_CONFIG.showSessionTitle,
showIcon: userConfig.showIcon ?? DEFAULT_CONFIG.showIcon,
customIconPath: userConfig.customIconPath ?? DEFAULT_CONFIG.customIconPath,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export const NotifierPlugin: Plugin = async ({ client, directory }) => {
}

const getConfig = () => loadConfig()
const projectName = directory ? basename(directory) : null
const projectName = directory ? (getConfig().showFullPath ? directory : basename(directory)) : null

// Fire client_connected after the plugin is fully initialized.
// There is no SDK event that reliably signals client connection from a plugin's
Expand Down
Loading