Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

neofetch: Strengthen scoop/choco app reporting #1642

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -1661,12 +1661,25 @@ get_packages() {
MSYS*) has pacman && tot pacman -Qq --color never ;;
esac

ProgramData=$(cygpath --folder 0x0023 2>/dev/null)
if [[ -z "$ProgramData" ]]; then
mount=$(awk '/^C:\s/ {print $2}' /proc/mounts 2>/dev/null)
ProgramData="${mount:-/cygdrive/c}/ProgramData"
fi

# Scoop environment throws errors if `tot scoop list` is used
has scoop && pkgs_h=1 dir ~/scoop/apps/* && ((packages-=1))
has scoop && {
sdir=$(cygpath "$SCOOP" 2>/dev/null)
sdir="${sdir:-$HOME/scoop}"
pkgs_h=1 dir "$sdir"/apps/* && ((packages-=1))
manager=scoop-global
sdir=$(cygpath "$SCOOP_GLOBAL" 2>/dev/null)
sdir="${sdir:-$ProgramData/scoop}"
dir "$sdir"/apps/*
}

# Count chocolatey packages.
[[ -d /cygdrive/c/ProgramData/chocolatey/lib ]] && \
dir /cygdrive/c/ProgramData/chocolatey/lib/*
has choco && dir "$ProgramData"/chocolatey/lib/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. I've previously changed it to has choco && tot choco list --localonly but choco list is really slow (>3s)

;;

Haiku)
Expand Down