From 5402ae32f54d014355a7c5c3a6db775cd152e04b Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Mon, 10 Nov 2025 17:12:14 +0100 Subject: [PATCH 1/2] Notification: make doNotDisturb non persistent (fixes #665) --- Assets/settings-default.json | 1 - Commons/Settings.qml | 1 - Modules/Bar/Widgets/NotificationHistory.qml | 6 +++--- .../Panels/ControlCenter/Widgets/Notifications.qml | 6 +++--- .../NotificationHistory/NotificationHistoryPanel.qml | 6 +++--- Modules/Panels/Settings/Tabs/NotificationsTab.qml | 4 ++-- Services/Control/IPCService.qml | 6 +++--- Services/System/NotificationService.qml | 12 +++++------- 8 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 27dd0e3b..94b3dfe2 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -206,7 +206,6 @@ }, "notifications": { "enabled": true, - "doNotDisturb": false, "monitors": [], "location": "top_right", "overlayLayer": true, diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 9600871b..81063cf2 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -342,7 +342,6 @@ Singleton { // notifications property JsonObject notifications: JsonObject { property bool enabled: true - property bool doNotDisturb: false property list monitors: [] property string location: "top_right" property bool overlayLayer: true diff --git a/Modules/Bar/Widgets/NotificationHistory.qml b/Modules/Bar/Widgets/NotificationHistory.qml index dbd9bea9..1dd21717 100644 --- a/Modules/Bar/Widgets/NotificationHistory.qml +++ b/Modules/Bar/Widgets/NotificationHistory.qml @@ -48,8 +48,8 @@ NIconButton { baseSize: Style.capsuleHeight applyUiScale: false density: Settings.data.bar.density - icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell" - tooltipText: Settings.data.notifications.doNotDisturb ? I18n.tr("tooltips.open-notification-history-disable-dnd") : I18n.tr("tooltips.open-notification-history-enable-dnd") + icon: NotificationService.doNotDisturb ? "bell-off" : "bell" + tooltipText: NotificationService.doNotDisturb ? I18n.tr("tooltips.open-notification-history-disable-dnd") : I18n.tr("tooltips.open-notification-history-enable-dnd") tooltipDirection: BarService.getTooltipDirection() colorBg: (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) colorFg: Color.mOnSurface @@ -61,7 +61,7 @@ NIconButton { panel?.toggle(this) } - onRightClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb + onRightClicked: NotificationService.doNotDisturb = !NotificationService.doNotDisturb Loader { anchors.right: parent.right diff --git a/Modules/Panels/ControlCenter/Widgets/Notifications.qml b/Modules/Panels/ControlCenter/Widgets/Notifications.qml index 54a8d4fc..1877130e 100644 --- a/Modules/Panels/ControlCenter/Widgets/Notifications.qml +++ b/Modules/Panels/ControlCenter/Widgets/Notifications.qml @@ -8,9 +8,9 @@ import qs.Widgets NIconButtonHot { property ShellScreen screen - icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell" - hot: Settings.data.notifications.doNotDisturb + icon: NotificationService.doNotDisturb ? "bell-off" : "bell" + hot: NotificationService.doNotDisturb tooltipText: I18n.tr("quickSettings.notifications.tooltip.action") onClicked: PanelService.getPanel("notificationHistoryPanel", screen)?.toggle(this) - onRightClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb + onRightClicked: NotificationService.doNotDisturb = !NotificationService.doNotDisturb } diff --git a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml index 53faaa8a..d0833879 100644 --- a/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml +++ b/Modules/Panels/NotificationHistory/NotificationHistoryPanel.qml @@ -56,10 +56,10 @@ SmartPanel { } NIconButton { - icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell" - tooltipText: Settings.data.notifications.doNotDisturb ? I18n.tr("tooltips.do-not-disturb-enabled") : I18n.tr("tooltips.do-not-disturb-disabled") + icon: NotificationService.doNotDisturb ? "bell-off" : "bell" + tooltipText: NotificationService.doNotDisturb ? I18n.tr("tooltips.do-not-disturb-enabled") : I18n.tr("tooltips.do-not-disturb-disabled") baseSize: Style.baseWidgetSize * 0.8 - onClicked: Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb + onClicked: NotificationService.doNotDisturb = !NotificationService.doNotDisturb } NIconButton { diff --git a/Modules/Panels/Settings/Tabs/NotificationsTab.qml b/Modules/Panels/Settings/Tabs/NotificationsTab.qml index 6c0a9e37..189e7038 100644 --- a/Modules/Panels/Settings/Tabs/NotificationsTab.qml +++ b/Modules/Panels/Settings/Tabs/NotificationsTab.qml @@ -42,8 +42,8 @@ ColumnLayout { NToggle { label: I18n.tr("settings.notifications.settings.do-not-disturb.label") description: I18n.tr("settings.notifications.settings.do-not-disturb.description") - checked: Settings.data.notifications.doNotDisturb - onToggled: checked => Settings.data.notifications.doNotDisturb = checked + checked: NotificationService.doNotDisturb + onToggled: checked => NotificationService.doNotDisturb = checked } NComboBox { diff --git a/Services/Control/IPCService.qml b/Services/Control/IPCService.qml index 6da76420..eea7eea0 100644 --- a/Services/Control/IPCService.qml +++ b/Services/Control/IPCService.qml @@ -62,13 +62,13 @@ Item { }) } function toggleDND() { - Settings.data.notifications.doNotDisturb = !Settings.data.notifications.doNotDisturb + NotificationService.doNotDisturb = !NotificationService.doNotDisturb } function enableDND() { - Settings.data.notifications.doNotDisturb = true + NotificationService.doNotDisturb = true } function disableDND() { - Settings.data.notifications.doNotDisturb = false + NotificationService.doNotDisturb = false } function clear() { NotificationService.clearHistory() diff --git a/Services/System/NotificationService.qml b/Services/System/NotificationService.qml index dcc78f20..277938a1 100644 --- a/Services/System/NotificationService.qml +++ b/Services/System/NotificationService.qml @@ -21,6 +21,8 @@ Singleton { // State property real lastSeenTs: 0 + // Volatile property that doesn't persist to settings (similar to noctaliaPerformanceMode) + property bool doNotDisturb: false // Models property ListModel activeList: ListModel {} @@ -161,7 +163,7 @@ Singleton { const data = createData(notification) addToHistory(data) - if (Settings.data.notifications?.doNotDisturb || PowerProfileService.noctaliaPerformanceMode) + if (root.doNotDisturb || PowerProfileService.noctaliaPerformanceMode) return // Check if this is a replacement notification @@ -728,11 +730,7 @@ Singleton { // Signals signal animateAndRemove(string notificationId) - Connections { - target: Settings.data.notifications - function onDoNotDisturbChanged() { - const enabled = Settings.data.notifications.doNotDisturb - ToastService.showNotice(enabled ? I18n.tr("toast.do-not-disturb.enabled") : I18n.tr("toast.do-not-disturb.disabled"), enabled ? I18n.tr("toast.do-not-disturb.enabled-desc") : I18n.tr("toast.do-not-disturb.disabled-desc"), enabled ? "bell-off" : "bell") - } + onDoNotDisturbChanged: { + ToastService.showNotice(doNotDisturb ? I18n.tr("toast.do-not-disturb.enabled") : I18n.tr("toast.do-not-disturb.disabled"), doNotDisturb ? I18n.tr("toast.do-not-disturb.enabled-desc") : I18n.tr("toast.do-not-disturb.disabled-desc"), doNotDisturb ? "bell-off" : "bell") } } From 20e10860606a759362cd64c4d93138e9760048ce Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Mon, 10 Nov 2025 17:17:31 +0100 Subject: [PATCH 2/2] Launcher: add CTRL+J/N keybinds (fixes #694) --- Modules/MainScreen/MainScreen.qml | 20 ++++++++++++++++++++ Modules/Panels/Launcher/Launcher.qml | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/Modules/MainScreen/MainScreen.qml b/Modules/MainScreen/MainScreen.qml index c01b7553..6586c59c 100644 --- a/Modules/MainScreen/MainScreen.qml +++ b/Modules/MainScreen/MainScreen.qml @@ -554,6 +554,26 @@ PanelWindow { } } + Shortcut { + sequence: "Ctrl+N" + enabled: root.isPanelOpen + onActivated: { + if (PanelService.openedPanel && PanelService.openedPanel.onCtrlNPressed) { + PanelService.openedPanel.onCtrlNPressed() + } + } + } + + Shortcut { + sequence: "Ctrl+P" + enabled: root.isPanelOpen + onActivated: { + if (PanelService.openedPanel && PanelService.openedPanel.onCtrlPPressed) { + PanelService.openedPanel.onCtrlPPressed() + } + } + } + Shortcut { sequence: "Left" enabled: root.isPanelOpen diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index 7cc1248a..9747b3ee 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -97,6 +97,14 @@ SmartPanel { selectPreviousWrapped() } + function onCtrlNPressed() { + selectNextWrapped() + } + + function onCtrlPPressed() { + selectPreviousWrapped() + } + // Public API for plugins function setSearchText(text) { searchText = text