Single-script builder (nosignal.sh) that turns a stock Arch Linux ISO into a fully-offline installer for a themed Hyprland + caelestia (Quickshell) desktop: matching SDDM greeter, Btrfs/Limine bootable snapshots, chwd-style GPU detection, and a curated "os updates" layer (keybind cheatsheet, settings panels, system polish, on-box management skill). See README.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3.3 KiB
notif-clear-fix — notifications popout "Clear" button did nothing
The fix lives in the nosignal-shell fork (package-owned file), so the
canonical fix is a one-handler change in the fork source; this folder also
ships a fallback patch for already-installed boxes.
Symptom
In the Notifications popout (off the bell), clicking Clear does nothing — the notification cards stay. Per-notification state is untouched; the count stays.
Root cause
modules/nsbar/panels/NsNotifications.qml Clear handler was:
onClicked: {
for (const n of Notifs.notClosed)
n.notification?.dismiss();
}
n is a NotifData wrapper. Clearing a notification is NotifData.close()
(services/NotifData.qml):
function close(): void {
closed = true; // drops it from notClosed → card disappears
if (locks.size === 0 && Notifs.list.includes(this)) {
Notifs.list = Notifs.list.filter(n => n !== this);
notification?.dismiss(); // dismiss the server obj (if any)
destroy();
}
}
The button skipped all of that and called only notification?.dismiss():
- it never set
closedor removed the item fromNotifs.list, sonotClosed(the popout's model) was unchanged → cards never disappear; and - for notifications restored from disk (
services/Notifs.qmlstorage/FileView),notificationis null, so?.dismiss()is a complete no-op.
The service already does it correctly in two places — the clearNotifs
CustomShortcut and the notifs IPC clear() both do
for (const notif of root.list.slice()) notif.close();. The button just didn't
match.
Fix
Make the Clear handler mirror the service:
onClicked: {
for (const n of Notifs.list.slice()) // slice() copy → safe to mutate mid-loop
n.close();
}
Corrected file: NsNotifications.qml (drop-in for
modules/nsbar/panels/NsNotifications.qml).
Integration
- Builder (canonical): replace
modules/nsbar/panels/NsNotifications.qmlin the nosignal-shell fork with the one here; rebuild the package. SetNOSIGNAL_SKIP_SHELL_PATCHfor the build so the fallback patch below is skipped. - Already-installed boxes (stopgap):
install-notif-clear-fix.shbacks up and overwrites the package-owned file. It is reverted by the nextnosignal-shellupgrade — which is fine, because that upgrade carries the fixed file once the fork is patched. Migration:1781470800-notif-clear-fix.sh(delegates via$NOSIGNAL_SRC). Shell restart required: the shell runs asqs -c caelestia -n -dand-ndisables the file watcher, so the patched file is NOT hot-reloaded — the user must restart the shell (Ctrl+Super+Alt+R, i.e.qs -c caelestia kill; sleep .1; caelestia shell -d) or log out/in for the new Clear handler to load. The installer prints this reminder.
Apply on this box now (needs root; sudo was password-prompted this session)
sudo sh ~/nosignal-handoff/notif-clear-fix/install-notif-clear-fix.sh
Then reload the shell (log out/in, or restart the caelestia shell). Quickshell usually hot-reloads on file change, so Clear may start working immediately.
Files
NsNotifications.qml,install-notif-clear-fix.sh,1781470800-notif-clear-fix.sh.