mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-14 23:21:19 +00:00
Add linux notifications
This commit is contained in:
parent
4530e8f9e3
commit
6b1a48f2fb
1 changed files with 16 additions and 0 deletions
|
|
@ -50,6 +50,19 @@ async function showWindowsNotification(options: NotificationOptions): Promise<vo
|
|||
}
|
||||
}
|
||||
|
||||
async function showLinuxNotification(options: NotificationOptions): Promise<void> {
|
||||
const { title = "", subtitle = "", message } = options
|
||||
|
||||
// Combine subtitle and message if subtitle exists
|
||||
const fullMessage = subtitle ? `${subtitle}\n${message}` : message
|
||||
|
||||
try {
|
||||
await execa("notify-send", [title, fullMessage])
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to show Linux notification: ${error}`)
|
||||
}
|
||||
}
|
||||
|
||||
export async function showSystemNotification(options: NotificationOptions): Promise<void> {
|
||||
try {
|
||||
const { title = "Cline", message } = options
|
||||
|
|
@ -65,6 +78,9 @@ export async function showSystemNotification(options: NotificationOptions): Prom
|
|||
case "win32":
|
||||
await showWindowsNotification({ ...options, title })
|
||||
break
|
||||
case "linux":
|
||||
await showLinuxNotification({ ...options, title })
|
||||
break
|
||||
default:
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue