feat(pkg): add cross-platform package manager support

Refactor pkg.fish to auto-detect the system package manager via
_fish_deps_detect_pm instead of hard-requiring paru/yay. Supports
install, uninstall, and auto (toggle) modes across paru, yay, pacman,
apt, dnf, zypper, yum, brew, and pkg. Package installed-checks now use
the correct query tool per PM (pacman -Qi, dpkg -s, rpm -q, etc.).

Also adds zypper to the _fish_deps_detect_pm detection priority list.
This commit is contained in:
2026-06-06 02:41:10 -04:00
parent 0dfd75923d
commit 00055a7c38
3 changed files with 149 additions and 50 deletions
+2 -2
View File
@@ -6,13 +6,13 @@
#
# DESCRIPTION
# Detects and prints the name of the first available system package manager
# from the priority list: paru, yay, pacman, apt, brew, pkg, dnf, yum.
# from the priority list: paru, yay, pacman, apt, brew, pkg, dnf, zypper, yum.
# Prints an empty string if none are found.
#
# EXAMPLE
# set pm (_fish_deps_detect_pm)
function _fish_deps_detect_pm
for pm in paru yay pacman apt brew pkg dnf yum
for pm in paru yay pacman apt brew pkg dnf zypper yum
if type -q $pm
echo $pm
return