HorlogeSkynet / archey4

:computer: Maintained fork of the original Archey (Linux) system tool
https://git.io/archey4
GNU General Public License v3.0
295 stars 37 forks source link

Show packages count divided by package manager #154

Closed cinghioGithub closed 6 months ago

cinghioGithub commented 6 months ago

Description

This PR changes the output provided by dividing the number of installed packages by package managers. It also adds support for flatpak and snap package count.

Reason and / or context

These changes allow to count flatpak and snap packages, also changing the total package count, moving from a total number to more precise data, showing the number of packages for each available package manager.

Example:

                                       User: username
                                       Hostname: hostname
                                       Model: machine_model
             ..vvAAAvv..               Distro: Ubuntu 22.04.4 LTS x86_64
        .:s/OOOOOOOOOOOOO\s:.          Kernel: Linux 6.8.0
      .sOOOOOOOOOOOOOO.vv.OOOs.        Uptime: 3 minutes
    .sOOOOOOOOO,ssssn:lMMl:OOOOs.      Load Average: 0.07 0.12 0.09
   :OOOOOOO.n@'MMMMMMy\^^/.OOOOOO:     Processes: 168
  :OOOOOOOiMMj@"OOOO"YIOOIlOOOOOOO:    Window Manager: Not detected
 .OOOOOO.MMMiOOOOOOOOOO`WMMM:OOOOOO.   Desktop Environment: GNOME
 iOO.vv.OJMWOOOOOOOOOOOOO:MMM:OOOOOi   Shell: /bin/bash
 OO:MMMM:lI:OOOOOOOOOOOOOii+iiOOOOOO   Terminal: xterm-256color ██ ██ ██ ██ ██ ██ ██
 iOO'YY'OJMMOOOOOOOOOOOOO:MMM:OOOOOi   Packages: (dpkg) 1432, (snap) 12
 'OOOOOO'MMMiOOOOOOOOOOO,MMMiOOOOOO'   Temperature: Not detected
  :OOOOOO'iMMY@,OOOOOO,;MMM/OOOOOO:    CPU: 13th Gen Intel(R) Core(TM) i9-13900H
   :OOOOOOO"Y@AMivviiY'__`'OOOOOO:     GPU: Red Hat, Inc. QXL paravirtual graphic card
    'QOOOOOOOO'"YYYYKOaMMM:OOOOP'      RAM: 1630 MiB / 3924 MiB
      'QOOOOOOOOOOOOOO`YY'OOOP'        Disk: 37.8 GiB / 88.0 GiB
        ':QOOOOOOOOOOOOOOOQ:'          LAN IP: 192.168.1.2
            '"":YOOOY:""'              WAN IP: Not detected

How has this been tested ?

It has been tested by updating the project's unittest suite.

Types of changes :

Checklist :

HorlogeSkynet commented 6 months ago

Hello @cinghioGithub, and many thanks for your PR (it was actually a long-term idea to change back-end for this purpose). Some notes :

Tell me what you think about this final implementation ! Bye :wave:

HorlogeSkynet commented 6 months ago

Up @cinghioGithub ! :pray:

cinghioGithub commented 6 months ago

Hi @HorlogeSkynet, sorry for the delay. I looked and everything seemed ok. I just don't know how much can be useful the show_zeros configuration option, but it is false by default so I like it. Thanks for fixing the style and adjusting the configuration as well.

HorlogeSkynet commented 6 months ago

I just don't know how much can be useful the show_zeros configuration option, but it is false by default so I like it.

I guess it could make sense to identify package manager back-ends that are not useful (no packages installed). Somehow, the option didn't cost much 🙃

Thanks for your feedback. Merging here.