mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 17:52:10 -04:00
Not everyone uses paru or yay on Arch: Support pacman command (#1900)
* Not everyone uses paru or yay on Arch: Support pacman command * Handle sudo properly when using pacman * Move pacman to bottom per Purian23 * Remote duplicate which -- thanks Purian23!
This commit is contained in:
@@ -44,24 +44,26 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property var archBasedPMSettings: {
|
readonly property var archBasedPMSettings: function(requiresSudo) {
|
||||||
"listUpdatesSettings": {
|
return {
|
||||||
"params": ["-Qu"],
|
"listUpdatesSettings": {
|
||||||
"correctExitCodes": [0, 1] // Exit code 0 = updates available, 1 = no updates
|
"params": ["-Qu"],
|
||||||
},
|
"correctExitCodes": [0, 1] // Exit code 0 = updates available, 1 = no updates
|
||||||
"upgradeSettings": {
|
},
|
||||||
"params": ["-Syu"],
|
"upgradeSettings": {
|
||||||
"requiresSudo": false
|
"params": ["-Syu"],
|
||||||
},
|
"requiresSudo": requiresSudo
|
||||||
"parserSettings": {
|
},
|
||||||
"lineRegex": /^(\S+)\s+([^\s]+)\s+->\s+([^\s]+)$/,
|
"parserSettings": {
|
||||||
"entryProducer": function (match) {
|
"lineRegex": /^(\S+)\s+([^\s]+)\s+->\s+([^\s]+)$/,
|
||||||
return {
|
"entryProducer": function (match) {
|
||||||
"name": match[1],
|
return {
|
||||||
"currentVersion": match[2],
|
"name": match[1],
|
||||||
"newVersion": match[3],
|
"currentVersion": match[2],
|
||||||
"description": `${match[1]} ${match[2]} → ${match[3]}`
|
"newVersion": match[3],
|
||||||
};
|
"description": `${match[1]} ${match[2]} → ${match[3]}`
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,8 +94,9 @@ Singleton {
|
|||||||
"checkupdates": archBasedUCSettings
|
"checkupdates": archBasedUCSettings
|
||||||
}
|
}
|
||||||
readonly property var packageManagerParams: {
|
readonly property var packageManagerParams: {
|
||||||
"yay": archBasedPMSettings,
|
"yay": archBasedPMSettings(false),
|
||||||
"paru": archBasedPMSettings,
|
"paru": archBasedPMSettings(false),
|
||||||
|
"pacman": archBasedPMSettings(true),
|
||||||
"dnf": fedoraBasedPMSettings
|
"dnf": fedoraBasedPMSettings
|
||||||
}
|
}
|
||||||
readonly property list<string> supportedDistributions: ["arch", "artix", "cachyos", "manjaro", "endeavouros", "fedora"]
|
readonly property list<string> supportedDistributions: ["arch", "artix", "cachyos", "manjaro", "endeavouros", "fedora"]
|
||||||
@@ -182,7 +185,7 @@ Singleton {
|
|||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: pkgManagerDetection
|
id: pkgManagerDetection
|
||||||
command: ["sh", "-c", "which paru || which yay || which dnf"]
|
command: ["sh", "-c", "which paru || which yay || which pacman || which dnf"]
|
||||||
|
|
||||||
onExited: exitCode => {
|
onExited: exitCode => {
|
||||||
if (exitCode === 0) {
|
if (exitCode === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user