From 061b92697cbcc637c96d04b0e89bf9cb94dee843 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Sat, 8 Nov 2025 09:13:48 +0100 Subject: [PATCH] NoctaliaPerformance: add performance toggle (disables shadows & animations) --- Assets/Translations/de.json | 2 ++ Assets/Translations/en.json | 2 ++ Assets/Translations/es.json | 2 ++ Assets/Translations/fr.json | 2 ++ Assets/Translations/pt.json | 2 ++ Assets/Translations/tr.json | 2 ++ Assets/Translations/uk-UA.json | 2 ++ Assets/Translations/zh-CN.json | 2 ++ Modules/Bar/Widgets/NoctaliaPerformance.qml | 30 +++++++++++++++++++++ Services/BarWidgetRegistry.qml | 4 +++ Services/PowerProfileService.qml | 4 +-- 11 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 Modules/Bar/Widgets/NoctaliaPerformance.qml diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index f82cef4e..7b336459 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "Nachtlicht ist aktiviert.\nLinksklick zum Wechseln des Modus.\nRechtsklick für Einstellungen.", "night-light-forced": "Nachtlicht ist erzwungen.\nLinksklick zum Wechseln des Modus.\nRechtsklick für Einstellungen.", "night-light-not-installed": "Nachtlicht ist nicht verfügbar.\nwlsunset ist nicht installiert.", + "noctalia-performance-disabled": "Noctalia-Leistungsmodus ist deaktiviert.\nLinksklick zum Aktivieren.", + "noctalia-performance-enabled": "Noctalia-Leistungsmodus ist aktiviert.\nLinksklick zum Deaktivieren.", "open-control-center": "Kontrollzentrum öffnen", "open-notification-history-disable-dnd": "Benachrichtigungsverlauf öffnen\nRechtsklick um 'Nicht stören' zu deaktivieren.", "open-notification-history-enable-dnd": "Benachrichtigungsverlauf öffnen\nRechtsklick um 'Nicht stören' zu aktivieren.", diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index ff6b949f..518eefb9 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "Night light is enabled.\nLeft click to cycle mode.\nRight click to access settings.", "night-light-forced": "Night light is forced.\nLeft click to cycle mode.\nRight click to access settings.", "night-light-not-installed": "Night light is not available.\nwlsunset is not installed.", + "noctalia-performance-disabled": "Noctalia performance mode is disabled.\nLeft click to enable.", + "noctalia-performance-enabled": "Noctalia performance mode is enabled.\nLeft click to disable.", "open-control-center": "Open control center", "open-notification-history-disable-dnd": "Open notification history\nRight-click to disable \"Do not disturb\".", "open-notification-history-enable-dnd": "Open notification history\nRight-click to enable \"Do not disturb\".", diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 147d9b3f..9399c515 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "Luz nocturna activada.\nClic izquierdo para cambiar de modo.\nClic derecho para acceder a la configuración.", "night-light-forced": "Luz nocturna forzada.\nClic izquierdo para cambiar de modo.\nClic derecho para acceder a la configuración.", "night-light-not-installed": "Luz nocturna no disponible.\nwlsunset no está instalado.", + "noctalia-performance-disabled": "El modo de rendimiento de Noctalia está desactivado.\nClic izquierdo para activar.", + "noctalia-performance-enabled": "El modo de rendimiento de Noctalia está activado.\nClic izquierdo para desactivar.", "open-control-center": "Abrir el centro de control", "open-notification-history-disable-dnd": "Abrir historial de notificaciones\nClic derecho para desactivar \"No molestar\".", "open-notification-history-enable-dnd": "Abrir historial de notificaciones\nClic derecho para activar \"No molestar\".", diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 8409bd0f..1eff9cdc 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "L'éclairage nocturne est activé.\nClic gauche pour changer de mode.\nClic droit pour accéder aux paramètres.", "night-light-forced": "L'éclairage nocturne est forcé.\nClic gauche pour changer de mode.\nClic droit pour accéder aux paramètres.", "night-light-not-installed": "L'éclairage nocturne n'est pas disponible.\nwlsunset n'est pas installé.", + "noctalia-performance-disabled": "Le mode performance Noctalia est désactivé.\nClic gauche pour activer.", + "noctalia-performance-enabled": "Le mode performance Noctalia est activé.\nClic gauche pour désactiver.", "open-control-center": "Ouvrir le centre de contrôle", "open-notification-history-disable-dnd": "Ouvrir l'historique des notifications\nClic droit pour désactiver \"Ne pas déranger\".", "open-notification-history-enable-dnd": "Ouvrir l'historique des notifications\nClic droit pour activer \"Ne pas déranger\".", diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index dab199b6..5fbcd5c5 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "Luz noturna ativada.\nClique esquerdo para alternar o modo.\nClique direito para acessar as configurações.", "night-light-forced": "Luz noturna forçada.\nClique esquerdo para alternar o modo.\nClique direito para acessar as configurações.", "night-light-not-installed": "Luz noturna não disponível.\nwlsunset não está instalado.", + "noctalia-performance-disabled": "O modo de desempenho Noctalia está desativado.\nClique esquerdo para ativar.", + "noctalia-performance-enabled": "O modo de desempenho Noctalia está ativado.\nClique esquerdo para desativar.", "open-control-center": "Abrir central de controle", "open-notification-history-disable-dnd": "Abrir histórico de notificações\nClique direito para desativar \"Não perturbe\".", "open-notification-history-enable-dnd": "Abrir histórico de notificações\nClique direito para ativar \"Não perturbe\".", diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 749063e9..7f3dd309 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "Gece ışığı etkin.\nMod arasında geçiş yapmak için sol tık.\nAyarlara erişmek için sağ tık.", "night-light-forced": "Gece ışığı zorla.\nMod arasında geçiş yapmak için sol tık.\nAyarlara erişmek için sağ tık.", "night-light-not-installed": "Gece ışığı mevcut değil.\nwlsunset yüklü değil.", + "noctalia-performance-disabled": "Noctalia performans modu devre dışı.\nEtkinleştirmek için sol tıklayın.", + "noctalia-performance-enabled": "Noctalia performans modu etkin.\nDevre dışı bırakmak için sol tıklayın.", "open-control-center": "Kontrol merkezini aç", "open-notification-history-disable-dnd": "Bildirim geçmişini aç\n\"Rahatsız etmeyi\" devre dışı bırakmak için sağ tık.", "open-notification-history-enable-dnd": "Bildirim geçmişini aç\n\"Rahatsız etmeyi\" etkinleştirmek için sağ tık.", diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index f32018c2..8f5e9163 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "Нічне світло увімкнено.\nЛівий клік для циклічного режиму.\nПравий клік для доступу до налаштувань.", "night-light-forced": "Нічне світло примусово.\nЛівий клік для циклічного режиму.\nПравий клік для доступу до налаштувань.", "night-light-not-installed": "Нічне світло недоступне.\nwlsunset не встановлено.", + "noctalia-performance-disabled": "Режим продуктивності Noctalia вимкнено.\nЛівий клік для увімкнення.", + "noctalia-performance-enabled": "Режим продуктивності Noctalia увімкнено.\nЛівий клік для вимкнення.", "open-control-center": "Відкрити центр керування", "open-notification-history-disable-dnd": "Відкрити історію сповіщень\nПравий клік для вимкнення \"Не турбувати\".", "open-notification-history-enable-dnd": "Відкрити історію сповіщень\nПравий клік для увімкнення \"Не турбувати\".", diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 4c6c57d6..6ab2bbef 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1798,6 +1798,8 @@ "night-light-enabled": "夜间模式已启用。\n左键点击循环模式。\n右键点击访问设置。", "night-light-forced": "夜间模式已强制启用。\n左键点击循环模式。\n右键点击访问设置。", "night-light-not-installed": "夜间模式不可用。\nwlsunset 未安装。", + "noctalia-performance-disabled": "Noctalia 性能模式已禁用。\n左键点击以启用。", + "noctalia-performance-enabled": "Noctalia 性能模式已启用。\n左键点击以禁用。", "open-control-center": "打开控制中心", "open-notification-history-disable-dnd": "打开通知历史记录\n右键点击禁用\"勿扰模式\"。", "open-notification-history-enable-dnd": "打开通知历史记录\n右键点击启用\"勿扰模式\"。", diff --git a/Modules/Bar/Widgets/NoctaliaPerformance.qml b/Modules/Bar/Widgets/NoctaliaPerformance.qml new file mode 100644 index 00000000..443832fc --- /dev/null +++ b/Modules/Bar/Widgets/NoctaliaPerformance.qml @@ -0,0 +1,30 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import Quickshell +import Quickshell.Wayland +import qs.Commons +import qs.Modules.Panels.Settings +import qs.Services +import qs.Widgets + +NIconButton { + id: root + + property ShellScreen screen + + density: Settings.data.bar.density + baseSize: Style.capsuleHeight + applyUiScale: false + colorBg: PowerProfileService.noctaliaPerformanceMode ? Color.mPrimary : (Settings.data.bar.showCapsule ? Color.mSurfaceVariant : Color.transparent) + colorFg: PowerProfileService.noctaliaPerformanceMode ? Color.mOnPrimary : Color.mOnSurface + colorBorder: Color.transparent + colorBorderHover: Color.transparent + + icon: PowerProfileService.noctaliaPerformanceMode ? "rocket" : "rocket-off" + tooltipText: PowerProfileService.noctaliaPerformanceMode ? I18n.tr("tooltips.noctalia-performance-enabled") : I18n.tr("tooltips.noctalia-performance-disabled") + tooltipDirection: BarService.getTooltipDirection() + onClicked: { + PowerProfileService.toggleNoctaliaPerformance() + } +} diff --git a/Services/BarWidgetRegistry.qml b/Services/BarWidgetRegistry.qml index 69d30d39..30cf715b 100644 --- a/Services/BarWidgetRegistry.qml +++ b/Services/BarWidgetRegistry.qml @@ -25,6 +25,7 @@ Singleton { "MediaMini": mediaMiniComponent, "Microphone": microphoneComponent, "NightLight": nightLightComponent, + "NoctaliaPerformance": noctaliaPerformanceComponent, "NotificationHistory": notificationHistoryComponent, "PowerProfile": powerProfileComponent, "ScreenRecorder": screenRecorderComponent, @@ -218,6 +219,9 @@ Singleton { property Component nightLightComponent: Component { NightLight {} } + property Component noctaliaPerformanceComponent: Component { + NoctaliaPerformance {} + } property Component notificationHistoryComponent: Component { NotificationHistory {} } diff --git a/Services/PowerProfileService.qml b/Services/PowerProfileService.qml index 160e5213..cb778628 100644 --- a/Services/PowerProfileService.qml +++ b/Services/PowerProfileService.qml @@ -112,9 +112,9 @@ Singleton { onNoctaliaPerformanceModeChanged: { if (noctaliaPerformanceMode) { - ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.enabled"), "seedling") + ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.enabled"), "rocket") } else { - ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.disabled"), "seedling-off") + ToastService.showNotice(I18n.tr("toast.noctalia-performance.label"), I18n.tr("toast.noctalia-performance.disabled"), "rocket-off") } } }