fastfetch-cli / fastfetch

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

Add Proxmox #507

Closed QFax closed 1 year ago

QFax commented 1 year ago

OS

os-release is identical to Debian, can be differentiated by the command pveversion,and packages such as: proxmox-ve, pve-firmware, pve-manager or one of the other packages here:http://download.proxmox.com/debian/pve/

Ascii

direct from neofetch:
EOF
        ;;

        "Proxmox"*)
            set_colors 7 202
            read -rd '' ascii_data <<'EOF'
${c1}         .://:`              `://:.
       `hMMMMMMd/          /dMMMMMMh`
        `sMMMMMMMd:      :mMMMMMMMs`
${c2}`-/+oo+/:${c1}`.yMMMMMMMh-  -hMMMMMMMy.`${c2}:/+oo+/-`
`:oooooooo/${c1}`-hMMMMMMMyyMMMMMMMh-`${c2}/oooooooo:`
  `/oooooooo:${c1}`:mMMMMMMMMMMMMm:`${c2}:oooooooo/`
    ./ooooooo+-${c1} +NMMMMMMMMN+ ${c2}-+ooooooo/.
      .+ooooooo+-${c1}`oNMMMMNo`${c2}-+ooooooo+.
        -+ooooooo/.${c1}`sMMs`${c2}./ooooooo+-
          :oooooooo/${c1}`..`${c2}/oooooooo:
          :oooooooo/`${c1}..${c2}`/oooooooo:
        -+ooooooo/.`${c1}sMMs${c2}`./ooooooo+-
      .+ooooooo+-`${c1}oNMMMMNo${c2}`-+ooooooo+.
    ./ooooooo+-${c1} +NMMMMMMMMN+ ${c2}-+ooooooo/.
  `/oooooooo:`${c1}:mMMMMMMMMMMMMm:${c2}`:oooooooo/`
`:oooooooo/`${c1}-hMMMMMMMyyMMMMMMMh-${c2}`/oooooooo:`
`-/+oo+/:`${c1}.yMMMMMMMh-  -hMMMMMMMy.${c2}`:/+oo+/-`
${c1}        `sMMMMMMMm:      :dMMMMMMMs`
       `hMMMMMMd/          /dMMMMMMh`
         `://:`              `://:`
EOF
CarterLi commented 1 year ago

Logo was added, but the detection was not implemented ( I don't think installing a package will magically make it a new distribution ). You may test it with fastfetch -l proxmox

QFax commented 1 year ago

Thanks for adding the logo, but I'd have to disagree with you.

I think Proxmox is far more than just a package. It replaces many of the base components of Debian, including the kernel, adds many features significantly changing the experience, and is, personally, far more different from Debian than Alma, Rocky, and RHEL are from each other, or Kubuntu and Ubuntu.

Though, if you insist I do somewhat understand, but think it's quite unfair, as simply rebuilding from source or adding a package do seem to make something a separate distro in other cases.

CarterLi commented 1 year ago

I'd like to support it, but I don't want to add special cases. If they decide not to change os-release, they still think they are debian. So why bother change that?

What does lsb_release -a print?

QFax commented 1 year ago

Sadly, it also prints Debian info. I checked for other methods and uname -r and -v do contain pve, I don't think that's helpful though.

CarterLi commented 1 year ago

Seems no better ideas. Closing

techie2000 commented 4 months ago

type -p pveversion will return something like /usr/bin/pveversion to let you know you are runnig proxmox flavour of debian.

echo $(pveversion) will return something like pve-manager/8.1.10/4b06efb5db453f29 (running kernel: 6.2.16-19-pve) to let you know which version of proxmox (8.1.10 in this case) and what modified kernal is being used (6.2.16-19-pve in this case)

Still no chance of tweaking src/detection/os/os_linux.c to capture this widely used debian variant (pretty please!)

Having played with fastfetch for the last 10minutes I would love to switch to it (from neofetch) but not recognising proxmox distinct from debian is problematic as I can't id at a glance whether I'm ssh'd to the host or one of the vm's running on it :(

CarterLi commented 4 months ago

Hello. Does this distro have /etc/lsb-release?

cedricroijakkers commented 4 months ago

Hello. Does this distro have /etc/lsb-release?

Just checked: no it doesn't.

I just looked it up in the neofetch code, they check for the presence of a file pveversion (which is under /usr/bin/pveversion in my system) and trigger the PVE detection on that.

CarterLi commented 4 months ago

What does /usr/bin/pveversion print?

cedricroijakkers commented 4 months ago
root@pve:~# /usr/bin/pveversion
pve-manager/8.2.2/9355359cd7afbae4 (running kernel: 6.8.4-2-pve)
CarterLi commented 4 months ago

Please test the latest dev build

cedricroijakkers commented 4 months ago

Tested successfully:

root@pve:~# fastfetch 
         .://:`              `://:.             root@pve
       `hMMMMMMd/          /dMMMMMMh`           --------
        `sMMMMMMMd:      :mMMMMMMMs`            OS: Proxmox VE bookworm 12.5 x86_64
`-/+oo+/:`.yMMMMMMMh-  -hMMMMMMMy.`:/+oo+/-`    Kernel: 6.8.4-2-pve
`:oooooooo/`-hMMMMMMMyyMMMMMMMh-`/oooooooo:`    Uptime: 9 days, 21 hours, 45 mins
  `/oooooooo:`:mMMMMMMMMMMMMm:`:oooooooo/`      Packages: 791 (dpkg)
    ./ooooooo+- +NMMMMMMMMN+ -+ooooooo/.        Shell: bash 5.2.15
      .+ooooooo+-`oNMMMMNo`-+ooooooo+.          Terminal: /dev/pts/0
        -+ooooooo/.`sMMs`./ooooooo+-            CPU: 13th Gen Intel(R) CoreT i5-1340P (16) @ 4.60 GHz
          :oooooooo/`..`/oooooooo:              GPU: Intel Iris Xe Graphics @ 1.45 GHz [Integrated]
          :oooooooo/`..`/oooooooo:              Memory: 16.42 GiB / 62.55 GiB (26%)
        -+ooooooo/.`sMMs`./ooooooo+-            Swap: Disabled
      .+ooooooo+-`oNMMMMNo`-+ooooooo+.          Disk (/): 2.16 GiB / 3.47 TiB (0%) - zfs
    ./ooooooo+- +NMMMMMMMMN+ -+ooooooo/.        Disk (/rpool): 128.00 KiB / 3.47 TiB (0%) - zfs
  `/oooooooo:`:mMMMMMMMMMMMMm:`:oooooooo/`      Local IP (vmbr0): 192.168.137.2/24 *
`:oooooooo/`-hMMMMMMMyyMMMMMMMh-`/oooooooo:`    Locale: en_US.UTF-8
`-/+oo+/:`.yMMMMMMMh-  -hMMMMMMMy.`:/+oo+/-`    
        `sMMMMMMMm:      :dMMMMMMMs`            ████████████████████████
       `hMMMMMMd/          /dMMMMMMh`           ████████████████████████
         `://:`              `://:`
CarterLi commented 4 months ago

I was expecting output of 8.2.2

What does fastfetch -s os --format json print?

cedricroijakkers commented 4 months ago
root@pve:~# fastfetch -s os --format json
[
  {
    "type": "OS",
    "result": {
      "buildID": "",
      "codename": "bookworm",
      "id": "pve",
      "idLike": "debian",
      "name": "Proxmox VE",
      "prettyName": "Proxmox VE 8.2.2",
      "variant": "",
      "variantID": "",
      "version": "12.5",
      "versionID": "12.5"
    }
  }
]
CarterLi commented 4 months ago

The distro version detection should be fixed in the latest commit

cedricroijakkers commented 4 months ago

It now returns:

root@pve:~# fastfetch 
         .://:`              `://:.             root@pve
       `hMMMMMMd/          /dMMMMMMh`           --------
        `sMMMMMMMd:      :mMMMMMMMs`            OS: Proxmox VE bookworm 8.2.2 x86_64
`-/+oo+/:`.yMMMMMMMh-  -hMMMMMMMy.`:/+oo+/-`    Kernel: 6.8.4-2-pve
`:oooooooo/`-hMMMMMMMyyMMMMMMMh-`/oooooooo:`    Uptime: 9 days, 23 hours, 40 mins
  `/oooooooo:`:mMMMMMMMMMMMMm:`:oooooooo/`      Packages: 791 (dpkg)
    ./ooooooo+- +NMMMMMMMMN+ -+ooooooo/.        Shell: bash 5.2.15
      .+ooooooo+-`oNMMMMNo`-+ooooooo+.          Terminal: /dev/pts/0
        -+ooooooo/.`sMMs`./ooooooo+-            CPU: 13th Gen Intel(R) CoreT i5-1340P (16) @ 4.60 GHz
          :oooooooo/`..`/oooooooo:              GPU: Intel Iris Xe Graphics @ 1.45 GHz [Integrated]
          :oooooooo/`..`/oooooooo:              Memory: 16.36 GiB / 62.55 GiB (26%)
        -+ooooooo/.`sMMs`./ooooooo+-            Swap: Disabled
      .+ooooooo+-`oNMMMMNo`-+ooooooo+.          Disk (/): 2.20 GiB / 3.47 TiB (0%) - zfs
    ./ooooooo+- +NMMMMMMMMN+ -+ooooooo/.        Disk (/rpool): 128.00 KiB / 3.47 TiB (0%) - zfs
  `/oooooooo:`:mMMMMMMMMMMMMm:`:oooooooo/`      Local IP (vmbr0): 192.168.137.2/24 *
`:oooooooo/`-hMMMMMMMyyMMMMMMMh-`/oooooooo:`    Locale: en_US.UTF-8
`-/+oo+/:`.yMMMMMMMh-  -hMMMMMMMy.`:/+oo+/-`    
        `sMMMMMMMm:      :dMMMMMMMs`            ████████████████████████
       `hMMMMMMd/          /dMMMMMMh`           ████████████████████████
         `://:`              `://:`
CarterLi commented 4 months ago

Nice.