neofetch
neofetch copied to clipboard
dnf method alone doesn't show package output
In the master branch, line 1571:
pac "$(sqlite3 /var/cache/dnf/packages.db "SELECT count(pkg) FROM installed")"
...does not increment the packages
variable, thus if dnf
is the only package method packages
will equal zero and the "Packages:" line is not displayed. Here's my very humble and mostly untested fix:
# Using the dnf package cache is much faster than rpm.
if has dnf && type -p sqlite3 >/dev/null && [[ -f /var/cache/dnf/packages.db ]]; then
dnfcnt="$(sqlite3 /var/cache/dnf/packages.db "SELECT count(pkg) FROM installed")"
pac "${dnfcnt}"
packages+=${dnfcnt}
else
In the master branch, line 1571:
pac "$(sqlite3 /var/cache/dnf/packages.db "SELECT count(pkg) FROM installed")"
...does not increment the
packages
variable, thus ifdnf
is the only package methodpackages
will equal zero and the "Packages:" line is not displayed.
I don't think this is true. Since has {manager}
sets the manager variable and pac {count}
appends the count with the manager to the finalized package count string, the original implementation should be correct. And it also runs correctly on my Fedora vps so it's correct.