dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide notifications: action-icons + inline reply support dfb1b5cf00aa05d483b211953a3357c0f8cd7af9
Oliver Jan Krylow <oliver@bugabinga.net > · 27 Jun 2026
unsigned
Browse files Compare with HEAD
Two freedesktop capabilities the server advertised or could advertise but
did not deliver:
- action-icons: the server already advertised actionIconsSupported, but
action buttons rendered text only. Thread hasActionIcons through the row;
when set, an action's identifier is a freedesktop icon name, so render it
as an IconImage beside the label.
- inline reply: flip inlineReplySupported on (changes GetCapabilities for
all clients). Thread hasInlineReply/inlineReplyPlaceholder through the row;
render a quick-reply TextInput in the full card when present; Enter routes
to the native sendInlineReply(). sendInlineReply already destroys the
native object, so closeNotification gains a skipNativeDismiss path to avoid
'Cannot close destroyed notification'. Added a notificationsReply IPC
handler as the headless control surface.
Verified: GetCapabilities lists action-icons + inline-reply; a gdbus
notification with hasInlineReply surfaces in state with the placeholder; an
IPC reply emits NotificationReplied(id,'omw') + NotificationClosed on the
bus with no errors; action-icons notification carries icon=<name> on the
server-action row. selftest green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changed files (4) Diff layout Auto Unified Split
quickshell/nuguland/NotificationCard.qml Modified +65 / −6 text lines
9 9 property bool compact: false property bool compact: false 10 10 signal dismiss (string id) signal dismiss (string id)11 11 signal invokeAction (string id, string actionId) signal invokeAction (string id, string actionId)
12 + signal sendReply (string id, string text)14 + readonly property bool canReply: ! compact && !! modelData.hasInlineReply221 224 delegate: Rectangle { delegate: Rectangle {222 225 id : actionBtn id : actionBtn223 226 required property var modelData required property var modelData
228 + readonly property string actIcon : String (actionBtn.modelData.icon || "" )224 229 height : 26 height : 26 225 - width : Math .max (58 , actLabel .implicitWidth + 18 )230 + width : Math .max (58 , actRow .implicitWidth + 18 )226 231 radius : 8 radius : 8 228 233 if (! card.theme) if (! card.theme)233 238 return card.theme.withAlpha(card.theme.ui.accent, 0.24 ); return card.theme.withAlpha(card.theme.ui.accent, 0.24 );234 239 return card.theme.withAlpha(card.theme.ui.accent, 0.14 ); return card.theme.withAlpha(card.theme.ui.accent, 0.14 );238 243 anchors.centerIn: parent anchors.centerIn: parent241 - text : actionBtn.modelData.label || "act" 246 + anchors.verticalCenter: parent.verticalCenter249 + source : actionBtn.actIcon250 + visible : actionBtn.actIcon.length > 0 254 + anchors.verticalCenter: parent.verticalCenter257 + text : actionBtn.modelData.label || "act" 243 260 MouseArea { MouseArea {244 261 id : actArea id : actArea
277 + height : card.canReply ? 30 : 0 278 + visible : card.canReply280 + color : card.theme ? card.theme.withAlpha(card.theme.ui.minor, 0.14 ) : "transparent" 281 + border.width: replyInput.activeFocus ? 1 : 0 282 + border.color: card.theme ? card.theme.ui.accent : "transparent" 286 + anchors.fill: parent287 + anchors.leftMargin: 10 288 + anchors.rightMargin: 10 289 + verticalAlignment : TextInput .AlignVCenter290 + color : card.theme ? card.theme.content.normal : "white" 291 + selectionColor : card.theme ? card.theme.ui.focus : "#ffffff" 292 + selectedTextColor : card.theme ? card.theme.content.backdrop : "black" 293 + font.family: "IBM Plex Sans" 297 + if (text.length > 0 ) {298 + card.sendReply(String (card.modelData.id), text);305 + anchors.left: parent.left306 + anchors.leftMargin: 10 307 + anchors.verticalCenter: parent.verticalCenter308 + visible : replyInput.text.length === 0 311 + text : card.modelData.inlineReplyPlaceholder || "Reply…" quickshell/nuguland/Notifications.qml Modified +56 / −5 text lines
107 107 "value" : Number (record.value !== undefined ? record.value : - 1 ), "value" : Number (record.value !== undefined ? record.value : - 1 ), 109 109 "resident" : !! record.resident, "resident" : !! record.resident,
111 + "hasActionIcons" : !! record.hasActionIcons, 113 + "hasInlineReply" : !! record.hasInlineReply, 114 + "inlineReplyPlaceholder" : String (record.inlineReplyPlaceholder || "" ), 110 115 "popup" : ! (dnd || popupInhibition), "popup" : ! (dnd || popupInhibition), 111 116 "closed" : false , "closed" : false , 112 117 "read" : false , "read" : false , 223 228 "transient" : notification.transient, "transient" : notification.transient, 224 229 "actions" : notification.actions || [], "actions" : notification.actions || [], 225 230 "value" : hintValue (notification), "value" : hintValue (notification), 226 - "resident" : notification.resident231 + "resident" : notification.resident, 232 + "hasActionIcons" : notification.hasActionIcons, 233 + "hasInlineReply" : notification.hasInlineReply, 234 + "inlineReplyPlaceholder" : notification.inlineReplyPlaceholder228 236 const eligible = toastEligible(row, dnd); const eligible = toastEligible(row, dnd);268 276 const serverActions = notification.actions || []; const serverActions = notification.actions || [];269 277 for (let i = 0 ; i < serverActions.length; i++ ) { for (let i = 0 ; i < serverActions.length; i++ ) {
278 + const aid = serverActions[i].id || serverActions[i].identifier || `action- ${i}` ;270 279 rows.push({ rows.push({271 - "id" : serverActions[i].id || serverActions[i].identifier || `action- ${i}` ,272 281 "kind" : "server-action" , "kind" : "server-action" ,273 282 "label" : serverActions[i].label || serverActions[i].text || "Action" , "label" : serverActions[i].label || serverActions[i].text || "Action" ,
284 + "icon" : notification.hasActionIcons ? aid : "" ,274 285 "route" : "Notifications.qml" "route" : "Notifications.qml" 445 456 return stateJson (); return stateJson ();448 - function closeNotification (row) {459 + function closeNotification (row, skipNativeDismiss ) {449 460 if (! row || row.closed) if (! row || row.closed)453 464 row.removalLifecycleLock = removalLifecycleLock; row.removalLifecycleLock = removalLifecycleLock;454 465 unreadCount = Math .max (0 , unreadCount - 1 ); unreadCount = Math .max (0 , unreadCount - 1 );455 466 const nativeNotification = nativeNotifications[String (row.nativeId || row.id)]; const nativeNotification = nativeNotifications[String (row.nativeId || row.id)];456 - if (nativeActionRoute && nativeNotification && nativeNotification.dismiss)470 + if (! skipNativeDismiss && nativeActionRoute && nativeNotification && nativeNotification.dismiss)457 471 nativeNotification.dismiss(); nativeNotification.dismiss();459 473 activeToasts = activeToasts.filter((x) => x !== String (row.id)); activeToasts = activeToasts.filter((x) => x !== String (row.id));533 547 return stateJson (); return stateJson ();
553 + function sendReply (notificationId, text) {554 + const id = String (notificationId);555 + const body = String (text || "" );556 + for (let i = 0 ; i < notifications.length; i++ ) {557 + const n = notifications[i];562 + const native = nativeNotifications[String (n.nativeId || n.id)];563 + if (body.length > 0 && native && native.hasInlineReply && native.sendInlineReply) {564 + native.sendInlineReply(body);568 + "kind" : "inline-reply" ,571 + "resident" : !! n.resident,572 + "route" : "Notifications.qml" 574 + if (sent && ! n.resident)575 + closeNotification(n, true );576 + notifications = notifications.slice(0 );582 + "route" : "Notifications.qml" 536 587 function toggleGroup (appName) { function toggleGroup (appName) {537 588 const app = String (appName); const app = String (appName);538 589 const expanded = expandedGroups.indexOf(app) < 0 ; const expanded = expandedGroups.indexOf(app) < 0 ;575 626 actionsSupported: true actionsSupported: true 576 627 actionIconsSupported: true actionIconsSupported: true 577 628 imageSupported: true imageSupported: true 578 - inlineReplySupported: false 629 + inlineReplySupported: true 579 630 onNotification : (notification) => { onNotification : (notification) => {580 631 return root.acceptNativeNotification(notification); return root.acceptNativeNotification(notification);quickshell/nuguland/PopoutHost.qml Modified +5 / −0 text lines
1250 1250 if (notificationService) if (notificationService)1251 1251 notificationService.runAction(id, actionId); notificationService.runAction(id, actionId);
1253 + function sendReply (id, text) {1254 + if (notificationService)1255 + notificationService.sendReply(id, text);1253 1257 function toggleGroup (appName) { function toggleGroup (appName) {1254 1258 if (notificationService) if (notificationService)1255 1259 notificationService.toggleGroup(appName); notificationService.toggleGroup(appName);1397 1401 modelData: cardWrap.modelData modelData: cardWrap.modelData1398 1402 onDismiss : (id) => root.runAction(id, "close" ) onDismiss : (id) => root.runAction(id, "close" )1399 1403 onInvokeAction : (id, actionId) => root.runAction(id, actionId) onInvokeAction : (id, actionId) => root.runAction(id, actionId)
1404 + onSendReply : (id, text) => root.sendReply(id, text)quickshell/nuguland/shell.qml Modified +4 / −0 text lines
631 631 return notifications.runAction(id, actionId); return notifications.runAction(id, actionId);
634 + function notificationsReply (id: string, text: string) : string {635 + return notifications.sendReply(id, text);634 638 function notificationsToggleGroup (appName: string) : string { function notificationsToggleGroup (appName: string) : string {635 639 return notifications.toggleGroup(appName); return notifications.toggleGroup(appName);