fastfetch-cli / fastfetch

An actively maintained, feature-rich and performance oriented, neofetch like system information tool.
MIT License
8.39k stars 351 forks source link

XBPS package count not detected #209

Closed hervyqa closed 1 year ago

hervyqa commented 1 year ago

General description of bug:

XBPS packages count should be detected.

LangitKetujuh OS (xbps, based on voidlinux)

Screenshot_20220803_164228

I tried on voidlinux fresh liveusb same result. Step:

sudo xbps-install -S Vulkan-Headers cmake pkg-config git
git clone https://github.com/LinusDierheimer/fastfetch
cd fastfetch
mkdir -p build
cd build
cmake ..
cmake --build . --target fastfetch --target flashfetch
./fastfetch

Screenshot_20220803_212952-2

Often helpful questions:

Output of fastfetch --version:

fastfetch 1.6.1

Output of fastfetch --load-config devinfo:

                                             l7@studio
                                             ---------
   . '7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7    OS: LangitKetujuh OS x86_64
   L7.   '7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7    Host: HP Laptop 14-cm0xxx
   L7L7L      7L7L7L7L7L7L7L7L7L7L7L7L7L7    Kernel: 5.18.14_1
   L7L7L7                          L7L7L7    Uptime: 14 mins
   L7L7L7           'L7L7L7L7L7L7L7L7L7L7    Packages: 2 (flatpak), 
   L7L7L7               'L7L7L7L7L7L7L7L7    Shell: fish 3.4.1
   L7L7L7                   'L7L7L7L7L7L7    Resolution: 1366x768 @ 60Hz
   L7L7L7                          L7L7L7    DE: KDE Plasma 5.25.3
   L7L7L7L7L7L7L7L7L7L7LL7L7L7.    '7L7L7    WM: KWin (X11)
   L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L.   'L7    WM Theme: Breeze
   L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7.  '    Theme: Breeze (Dark) [QT], Breeze-Dark [GTK2/3], Breeze [GTK4]
                                             Icons: Papirus-Dark [QT], Papirus-Dark [GTK2/3/4]
                                             Font: Noto Sans (9pt) [QT], Noto Sans (9pt) [GTK2/3/4]
                                             Cursor: breeze (24px)
                                             Terminal: konsole
                                             Terminal Font: Hack (9pt)
                                             CPU: AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G (2) @ 2.3GHz
                                             GPU: AMD ATI Radeon R2/R3/R4/R5 Graphics
                                             Memory: 2021MiB / 3806MiB (53%)
                                             Disk (/): 21.0 GB / 30.0GiB (69%)
                                             Disk (/home): 76.9 GB / 81.3GiB (94%)
                                             Battery: 87% [Charging]
                                             Locale: en_US.UTF-8

                                             ████████████████████████
                                             ████████████████████████

Output of fastfetch --load-config devinfo-verbose:

➜  ~ fastfetch --load-config devinfo-verbose
                                             l7@studio
                                             ---------
   . '7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7    OS: System: Linux; Name: LangitKetujuh OS; Pretty name: LangitKetujuh; ID: langitketujuh; ID like: ; Variant: ; Variant ID: ; Version: ; Version ID: ; Version codename: ; Build ID: ; Architecture: x86_64
   L7L7L      7L7L7L7L7L7L7L7L7L7L7L7L7L7    Host: Family: "product_family: 103C_5335KV HP Notebook; product_name: HP Laptop 14-cm0xxx; product_version: ; product_sku: 5HJ74PA#AR6; bios_date: 05/17/2018; bios_release: 15.10; bios_vendor: AMI; bios_version: F.10; board_name: 84A0; board_vendor: HP; board_version: 83.16; chassis_type: 10; chassis_vendor: HP; chassis_version: Chassis Version; sys_vendor: HPL7L7L7L7    
   L7L7L7               'L7L7L7L7L7L7L7L7    Kernel: Sysname: Linux; Release: 5.18.14_1; Version: #1 SMP PREEMPT_DYNAMIC Sun Jul 24 05:20:02 UTC 2022
   L7L7L7                   'L7L7L7L7L7L7    Uptime: Days: 0; Hours: 0; Minutes: 16; Seconds: 5
   L7L7L7                          L7L7L7    Processes: Count: 626
   L7L7L7L7L7L7L7L7L7L7LL7L7L7.    '7L7L7    Packages: All: 1757; pacman: 0; pacman branch: ; dpkg: 0; rpm: 0; emerge: 0; xbps: 1755; flatpak: 0; snap: 0
   L7L7L7L7L7L7L7L7L7L7L7L7L7L7L7L.   'L7    Shell: Process name: fish; Process path: /bin/fish; Process exe: fish; Process version: 3.4.1; User path: /bin/fish; User exe: fish; User version: 3.4.17L7L7L7L7L7L7L7L7L7L7L7L7L7.  '    
                                             Resolution: Width: 1366; Height: 768; Refresh rate: 60
                                             DE: Process name: plasmashell; Pretty name: KDE Plasma; Version: 5.25.3
                                             WM: Process name: KWin; Pretty name: KWin; Protocol: X11
                                             WM Theme: Name: Breeze
                                             Theme: Plasma: Breeze; Plasma colors: Breeze Dark; Plasma colors pretty: Dark; GTK2: Breeze-Dark; GTK3: Breeze-Dark; GTK4: Breeze; GTK: Breeze-Dark [GTK2/3], Breeze [GTK4]
                                             Icons: Plasma: Papirus-Dark; GTK2: Papirus-Dark; GTK3: Papirus-Dark; GTK4: Papirus-Dark; GTK: Papirus-Dark [GTK2/3/4]
                                             Font: Plasma raw: Noto Sans,9,-1,5,50,0,0,0,0,0; Plasma name: Noto Sans; Plasma size: 9; Plasma styles: ; Plasma pretty: Noto Sans (9pt); GTK2 raw: Noto Sans,  9; GTK2 name: Noto Sans; GTK2 size: 9; GTK2 styles: ; GTK2 pretty: Noto Sans (9pt); GTK3 raw: Noto Sans,  9; GTK3 name: Noto Sans; GTK3 size: 9; GTK3 styles: ; GTK3 pretty: Noto Sans (9pt); GTK4 raw: Noto Sans,  9; GTK4 name: Noto Sans; GTK4 size: 9; GTK4 styles: ; GTK4 pretty: Noto Sans (9pt); GTK: Noto Sans (9pt) [GTK2/3/4]
                                             Cursor: Theme: breeze; Size: 24
                                             Terminal: Process: konsole; Path: /usr/bin/konsole; Exe: konsole
                                             Terminal Font: Raw: Hack,9,-1,5,50,0,0,0,0,0; Name: Hack; Size: 9; Styles: ; Pretty: Hack (9pt)
                                             CPU: Name: AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G; Pretty: AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G; Vendor: AuthenticAMD; Logical online: 2; Logical configured: 2; Physical: 2; Cores: 2; temperature: 48.25; bios: 2.3; scaling max: 2.3; scaling min: 1.3; info max: 2.3; info min: 1.3; cpuinfo: 2.27371; frequency: 2.3
                                             GPU: Vendor: Advanced Micro Devices, Inc. [AMD/ATI]; Vendor pretty: AMD ATI; Name: Stoney [Radeon R2/R3/R4/R5 Graphics]; Name pretty: Radeon R2/R3/R4/R5 Graphics; Driver: amdgpu; Temperature: 48
                                             Memory: Used: 2005; Total: 3806; Percentage: 52
                                             Disk (/): Used: 20.9892; Total: 29.998; Files: 2.6031e-317; Percentage: 69
                                             Disk (/home): Used: 76.8868; Total: 81.2875; Files: 1.28823e-231; Percentage: 94
                                             Battery: Manufactor: Hewlett-Packard; Model: Primary; Technology: Li-ion; Capacaty: 87; Status: Charging
                                             Media Player: No media player found
                                             Song: No song detected
                                             Public IP: -
                                             Local IP (wlp3s0): -
                                             Date & Time: year: 2022; yearShort: 22; month: 8; monthPretty: 08; monthName: August; monthNameShort: Aug; weekNumber: 31; weekday: Thursday; weekdayShort: Thu; dayInYear: 216; dayInMonth: 4; dayInWeek: 4; hour: 5; hourPretty: 05; hour12: 5; hour12Pretty: 05; minute: 10; minutePretty: 10; second: 39; secondPretty: 39
                                             Locale: en_US.UTF-8
                                             Vulkan: driver: radv [Mesa 22.1.3]; Api Version: 1.3.204; Conformance Version: 1.2.1
                                             OpenGL: version: 4.5 (Compatibility Profile) Mesa 22.1.3; renderer: AMD STONEY (LLVM 12.0.1, DRM 3.46, 5.18.14_1); vendor: AMD
                                             OpenCL: version: OpenCL 1.1 Mesa 22.1.3; device: AMD STONEY (LLVM 12.0.1, DRM 3.46, 5.18.14_1); vendor: AMD

                                             ████████████████████████
                                             ████████████████████████
➜  ~ 

Output of fastfetch --list-features:

libpci
vulkan
wayland
xcb-randr
xcb
xrandr
x11
gio
dconf
dbus
imagemagick7
zlib
xfconf
sqlite3
rpm
egl
glx
osmesa
opencl
hervyqa commented 1 year ago

pacman detected as default.

➜  ~ fastfetch --help packages-format
--packages-format:
Sets the format string for packages output.
To see how a format string is constructed, take a look at "fastfetch --help format".
The following values are passed:
        {1}: Number of all packages
        {2}: Number of pacman packages
        {3}: Pacman branch on manjaro
        {4}: Number of dpkg packages
        {5}: Number of rpm packages
        {6}: Number of emerge packages
        {7}: Number of xbps packages
        {8}: Number of nix-system packages
        {9}: Number of nix-user packages
        {10}: Number of nix-default packages
        {11}: Number of flatpak packages
The default is something similar to "{2} (pacman){?3}[{3}]{?}, {4} (dpkg), {5} (rpm), {6} (emerge), {7} (xbps), {8} (nix-user), {9} (nix-default), {10} (flatpak), {11} (snap)".
LinusDierheimer commented 1 year ago

Does ls /var/db/xbps list one file for each installed package?

hervyqa commented 1 year ago

Does ls /var/db/xbps list one file for each installed package?

all installed package data is in pkgdb-0.38.plist. my pkgdb: pkgdb-0.38.plist.zip

a list of all the contents of the folder is here (with dot files). ls -lah /var/db/xbps/ > list.txt

list.txt (dot plist files are packages installed with listed repositories only, not with self-installed packages by manually installing .xbps packages. but with xbps-query -l can enumerate all packages including manually installed ones)

➜  ~ xbps-query -l | wc -l
1740
➜  ~ 
LinusDierheimer commented 1 year ago

Can you please test it?

hervyqa commented 1 year ago

Can you please test it?

still empty.

Screenshot_20220808_073236

but if i use --packages-format "{} (xbps)" or --packages-format "{7}" it appears.

Screenshot_20220808_073447

Screenshot_20220808_073723

hervyqa commented 1 year ago

I don't think it's about how to calculate it (previously it could be calculated with --packages-format {7}), but it's about displaying the result. sorry, I can't make a patch. can only test it.

LinusDierheimer commented 1 year ago

Pretty sure i fixed it, please test

hervyqa commented 1 year ago

Pretty sure i fixed it, please test

Finally 🎉

Screenshot_20220812_144926