From 03cfa55e0ba6aeee8f9567a7cffafeae96768d56 Mon Sep 17 00:00:00 2001 From: bbedward Date: Sat, 24 Jan 2026 12:53:51 -0500 Subject: [PATCH] ipc: ass toast IPCs fixes #964 --- quickshell/DMSShellIPC.qml | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/quickshell/DMSShellIPC.qml b/quickshell/DMSShellIPC.qml index 6ec2d3b6..15547c3d 100644 --- a/quickshell/DMSShellIPC.qml +++ b/quickshell/DMSShellIPC.qml @@ -1114,6 +1114,79 @@ Item { target: "spotlight" } + IpcHandler { + function info(message: string): string { + if (!message) + return "ERROR: No message specified"; + + ToastService.showInfo(message); + return "TOAST_INFO_SUCCESS"; + } + + function infoWith(message: string, details: string, command: string, category: string): string { + if (!message) + return "ERROR: No message specified"; + + ToastService.showInfo(message, details, command, category); + return "TOAST_INFO_SUCCESS"; + } + + function warn(message: string): string { + if (!message) + return "ERROR: No message specified"; + + ToastService.showWarning(message); + return "TOAST_WARN_SUCCESS"; + } + + function warnWith(message: string, details: string, command: string, category: string): string { + if (!message) + return "ERROR: No message specified"; + + ToastService.showWarning(message, details, command, category); + return "TOAST_WARN_SUCCESS"; + } + + function error(message: string): string { + if (!message) + return "ERROR: No message specified"; + + ToastService.showError(message); + return "TOAST_ERROR_SUCCESS"; + } + + function errorWith(message: string, details: string, command: string, category: string): string { + if (!message) + return "ERROR: No message specified"; + + ToastService.showError(message, details, command, category); + return "TOAST_ERROR_SUCCESS"; + } + + function hide(): string { + ToastService.hideToast(); + return "TOAST_HIDE_SUCCESS"; + } + + function dismiss(category: string): string { + if (!category) + return "ERROR: No category specified"; + + ToastService.dismissCategory(category); + return "TOAST_DISMISS_SUCCESS"; + } + + function status(): string { + if (!ToastService.toastVisible) + return "hidden"; + + const levels = ["info", "warn", "error"]; + return `visible:${levels[ToastService.currentLevel]}:${ToastService.currentMessage}`; + } + + target: "toast" + } + IpcHandler { function open(): string { FirstLaunchService.showWelcome();