diff --git a/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml b/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml index 43203fc..9152ddd 100644 --- a/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml +++ b/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml @@ -112,7 +112,11 @@ NPanel { label: "" description: "" checked: ArchUpdaterService.isPackageSelected(modelData.name) - onToggled: ArchUpdaterService.togglePackageSelection(modelData.name) + onToggled: function (checked) { + ArchUpdaterService.togglePackageSelection(modelData.name) + // Force refresh of the checked property + checkbox.checked = ArchUpdaterService.isPackageSelected(modelData.name) + } activeColor: (modelData.source === "aur") ? Color.mSecondary : Color.mPrimary activeOnColor: (modelData.source === "aur") ? Color.mOnSecondary : Color.mOnPrimary Layout.fillWidth: false diff --git a/Modules/SettingsPanel/Tabs/DisplayTab.qml b/Modules/SettingsPanel/Tabs/DisplayTab.qml index eb9a766..5dfcbfe 100644 --- a/Modules/SettingsPanel/Tabs/DisplayTab.qml +++ b/Modules/SettingsPanel/Tabs/DisplayTab.qml @@ -303,11 +303,11 @@ ColumnLayout { } } - // Temperature + // Temperature ColumnLayout { spacing: Style.marginXS * scaling Layout.alignment: Qt.AlignVCenter - + NLabel { label: "Color temperature" description: "Select two temperatures in Kelvin" @@ -317,7 +317,7 @@ ColumnLayout { visible: Settings.data.nightLight.enabled spacing: Style.marginM * scaling Layout.fillWidth: false - Layout.fillHeight: true + Layout.fillHeight: true Layout.alignment: Qt.AlignVCenter NText { diff --git a/Services/ArchUpdaterService.qml b/Services/ArchUpdaterService.qml index 84c8228..de3b3af 100644 --- a/Services/ArchUpdaterService.qml +++ b/Services/ArchUpdaterService.qml @@ -142,28 +142,40 @@ Singleton { return updateInProgress = true + // Split selected packages by source - const repoPkgs = selectedPackages.filter(pkg => { - const repoPkg = repoPackages.find(p => p.name === pkg) - return repoPkg && repoPkg.source === "repo" - }) - const aurPkgs = selectedPackages.filter(pkg => { - const aurPkg = aurPackages.find(p => p.name === pkg) - return aurPkg && aurPkg.source === "aur" - }) + const repoPkgs = [] + const aurPkgs = [] + + for (const pkgName of selectedPackages) { + const repoPkg = repoPackages.find(p => p.name === pkgName) + if (repoPkg && repoPkg.source === "repo") { + repoPkgs.push(pkgName) + } + + const aurPkg = aurPackages.find(p => p.name === pkgName) + if (aurPkg && aurPkg.source === "aur") { + aurPkgs.push(pkgName) + } + } // Update repo packages if (repoPkgs.length > 0) { const repoCommand = ["pkexec", "pacman", "-S", "--noconfirm"].concat(repoPkgs) + Logger.log("ArchUpdater", "Running repo command:", repoCommand.join(" ")) Quickshell.execDetached(repoCommand) } // Update AUR packages if (aurPkgs.length > 0) { - const aurCommand = ["sh", "-c", `command -v yay >/dev/null 2>&1 && yay -S ${aurPkgs.join( - ' ')} --noconfirm || command -v paru >/dev/null 2>&1 && paru -S ${aurPkgs.join( - ' ')} --noconfirm || true`] - Quickshell.execDetached(aurCommand) + const aurHelper = getAurHelper() + if (aurHelper) { + const aurCommand = [aurHelper, "-S", "--noconfirm"].concat(aurPkgs) + Logger.log("ArchUpdater", "Running AUR command:", aurCommand.join(" ")) + Quickshell.execDetached(aurCommand) + } else { + Logger.warn("ArchUpdater", "No AUR helper found for packages:", aurPkgs.join(", ")) + } } // Clear selection and refresh @@ -172,6 +184,22 @@ Singleton { refreshAfterUpdate() } + // Helper function to detect AUR helper + function getAurHelper() { + // Check for yay first, then paru + const yayCheck = Quickshell.exec("command -v yay", true) + if (yayCheck.exitCode === 0 && yayCheck.stdout.trim()) { + return "yay" + } + + const paruCheck = Quickshell.exec("command -v paru", true) + if (paruCheck.exitCode === 0 && paruCheck.stdout.trim()) { + return "paru" + } + + return null + } + // Package selection functions function togglePackageSelection(packageName) { const index = selectedPackages.indexOf(packageName) diff --git a/Widgets/NTextInput.qml b/Widgets/NTextInput.qml index 78fcd11..6533af9 100644 --- a/Widgets/NTextInput.qml +++ b/Widgets/NTextInput.qml @@ -25,16 +25,16 @@ ColumnLayout { NLabel { label: root.label description: root.description - visible: root.label !== "" || root.description !== "" + visible: root.label !== "" || root.description !== "" } // Container Rectangle { id: frame implicitWidth: parent.width - implicitHeight: Style.baseWidgetSize * 1.1 * scaling + implicitHeight: Style.baseWidgetSize * 1.1 * scaling Layout.minimumWidth: 80 * scaling - Layout.maximumWidth: root.inputMaxWidth + Layout.maximumWidth: root.inputMaxWidth radius: Style.radiusM * scaling color: Color.mSurface border.color: Color.mOutline