diff --git a/shell/modules/Bar.qml b/shell/modules/Bar.qml index 84261d5..343b682 100644 --- a/shell/modules/Bar.qml +++ b/shell/modules/Bar.qml @@ -145,7 +145,7 @@ PanelWindow { id: _windowTitleGroup Layout.minimumWidth: 0 clip: true - visible: S.Modules.windowTitle.enable && M.NiriIpc.focusedTitle !== "" + visible: S.Modules.windowTitle.enable && S.NiriIpc.focusedTitle !== "" M.WindowTitleModule { id: _windowTitle readonly property real _maxWidth: Math.max(0, centerSection.x - _windowTitleGroup.x - 2 * S.Theme.groupPadding - S.Theme.groupSpacing) diff --git a/shell/modules/NotifPopup.qml b/shell/modules/NotifPopup.qml index 4214894..d9a5ffb 100644 --- a/shell/modules/NotifPopup.qml +++ b/shell/modules/NotifPopup.qml @@ -10,7 +10,7 @@ PanelWindow { required property var screen - visible: M.NotifService.popups.length > 0 && !M.NiriIpc.overviewOpen + visible: M.NotifService.popups.length > 0 && !S.NiriIpc.overviewOpen color: "transparent" WlrLayershell.layer: WlrLayer.Overlay diff --git a/shell/modules/OverviewBackdrop.qml b/shell/modules/OverviewBackdrop.qml index 58a67fb..6b145a5 100644 --- a/shell/modules/OverviewBackdrop.qml +++ b/shell/modules/OverviewBackdrop.qml @@ -24,6 +24,6 @@ PanelWindow { C.HexWaveBackground { anchors.fill: parent - running: M.NiriIpc.overviewOpen + running: S.NiriIpc.overviewOpen } } diff --git a/shell/modules/PowerProfileModule.qml b/shell/modules/PowerProfileModule.qml index 8367f3a..58e61e9 100644 --- a/shell/modules/PowerProfileModule.qml +++ b/shell/modules/PowerProfileModule.qml @@ -4,16 +4,16 @@ import "../services" as S M.BarIcon { id: root - tooltip: "Power profile: " + (M.PowerProfileService.profile || "unknown") + tooltip: "Power profile: " + (S.PowerProfileService.profile || "unknown") - color: M.PowerProfileService.profile === "performance" ? S.Theme.base09 : M.PowerProfileService.profile === "power-saver" ? S.Theme.base0B : root.accentColor + color: S.PowerProfileService.profile === "performance" ? S.Theme.base09 : S.PowerProfileService.profile === "power-saver" ? S.Theme.base0B : root.accentColor icon: { - if (M.PowerProfileService.profile === "performance") + if (S.PowerProfileService.profile === "performance") return "\uF0E7"; - if (M.PowerProfileService.profile === "power-saver") + if (S.PowerProfileService.profile === "power-saver") return "\uF06C"; - if (M.PowerProfileService.profile === "balanced") + if (S.PowerProfileService.profile === "balanced") return "\uF24E"; return "\uF0E7"; } @@ -23,8 +23,8 @@ M.BarIcon { cursorShape: Qt.PointingHandCursor onClicked: { const cycle = ["performance", "balanced", "power-saver"]; - const idx = cycle.indexOf(M.PowerProfileService.profile); - M.PowerProfileService.set(cycle[(idx + 1) % cycle.length]); + const idx = cycle.indexOf(S.PowerProfileService.profile); + S.PowerProfileService.set(cycle[(idx + 1) % cycle.length]); } } } diff --git a/shell/modules/WindowTitleModule.qml b/shell/modules/WindowTitleModule.qml index 822d46b..98b1215 100644 --- a/shell/modules/WindowTitleModule.qml +++ b/shell/modules/WindowTitleModule.qml @@ -8,12 +8,12 @@ import "../services" as S M.BarSection { id: root spacing: S.Theme.moduleSpacing - tooltip: M.NiriIpc.focusedAppId ? M.NiriIpc.focusedAppId + "\n" + M.NiriIpc.focusedTitle : M.NiriIpc.focusedTitle + tooltip: S.NiriIpc.focusedAppId ? S.NiriIpc.focusedAppId + "\n" + S.NiriIpc.focusedTitle : S.NiriIpc.focusedTitle readonly property string _iconSource: { - if (!M.NiriIpc.focusedAppId) + if (!S.NiriIpc.focusedAppId) return ""; - const entry = DesktopEntries.heuristicLookup(M.NiriIpc.focusedAppId); + const entry = DesktopEntries.heuristicLookup(S.NiriIpc.focusedAppId); return entry ? Quickshell.iconPath(entry.icon) : ""; } @@ -37,7 +37,7 @@ M.BarSection { M.BarLabel { id: _label - label: M.NiriIpc.focusedTitle + label: S.NiriIpc.focusedTitle color: root.accentColor elide: Text.ElideRight anchors.verticalCenter: parent.verticalCenter diff --git a/shell/modules/WorkspacesModule.qml b/shell/modules/WorkspacesModule.qml index d261238..ed13927 100644 --- a/shell/modules/WorkspacesModule.qml +++ b/shell/modules/WorkspacesModule.qml @@ -36,7 +36,7 @@ Row { // Live updates via shared NiriIpc singleton Connections { - target: M.NiriIpc + target: S.NiriIpc function onWorkspacesChanged(workspaces) { root._allWorkspaces = workspaces.sort((a, b) => a.idx - b.idx); } diff --git a/shell/modules/qmldir b/shell/modules/qmldir index 8cb3af5..49e65fd 100644 --- a/shell/modules/qmldir +++ b/shell/modules/qmldir @@ -30,8 +30,6 @@ WeatherModule 1.0 WeatherModule.qml PowerProfileModule 1.0 PowerProfileModule.qml IdleInhibitorModule 1.0 IdleInhibitorModule.qml NotificationsModule 1.0 NotificationsModule.qml -singleton NiriIpc 1.0 NiriIpc.qml -singleton PowerProfileService 1.0 PowerProfileService.qml ProcessList 1.0 ProcessList.qml singleton NotifService 1.0 NotifService.qml NotifItem 1.0 NotifItem.qml diff --git a/shell/modules/NiriIpc.qml b/shell/services/NiriIpc.qml similarity index 100% rename from shell/modules/NiriIpc.qml rename to shell/services/NiriIpc.qml diff --git a/shell/modules/PowerProfileService.qml b/shell/services/PowerProfileService.qml similarity index 97% rename from shell/modules/PowerProfileService.qml rename to shell/services/PowerProfileService.qml index 432ca18..834be8f 100644 --- a/shell/modules/PowerProfileService.qml +++ b/shell/services/PowerProfileService.qml @@ -2,8 +2,7 @@ pragma Singleton import QtQuick import Quickshell.Io -import "." as M -import "../services" as S +import "." as S QtObject { id: root diff --git a/shell/services/qmldir b/shell/services/qmldir index 0131301..e411660 100644 --- a/shell/services/qmldir +++ b/shell/services/qmldir @@ -2,3 +2,5 @@ module services singleton Theme 1.0 Theme.qml singleton SystemStats 1.0 SystemStats.qml singleton Modules 1.0 Modules.qml +singleton NiriIpc 1.0 NiriIpc.qml +singleton PowerProfileService 1.0 PowerProfileService.qml