ss7m / paleofetch

neofetch, but written in C
MIT License
167 stars 49 forks source link

Add get_diskspace? #48

Closed petterssonjonas closed 4 years ago

petterssonjonas commented 4 years ago

I gave it a try, but being a pleb python scripter i couldnt get it working. Maybe i should write a clone in python :) As far as i can tell it would'nt be a major project adding though, either using statvfs.h or even calling df. But you might not even want to add it, idk your philosophy on the project. If not im gonna give it another try. I really want used/free space for a few mount points.

Also when i GPU_REMOVE "NVIDIA", "CORPORATION", "TU", "116", "[", "]", i get a blank space left ahead of the gpu name. Just a little annoyance.

Also it would be cool querying AUR packages separately...

And as a little gift i stole another logo from pfetch and made a arch.h.

// This was stolen from pfetch by fuzebox
char *LOGO[] = {
    "                             ",
    "                             ",
    "                             ",
    "             /\\              ",
    "            /  \\             ",
    "           /\\   \\           ",
    "          /      \\           ",
    "         /   ,,   \\          ",
    "        /   |  |  -\\         ",
    "       /_-''    ''-_\\        ",
    "                             ",
    "                             ",
    "                             ",
    "                             "
};

jJteJQg

ss7m commented 4 years ago

Getting disk space usage could be neat functionality to add, and probably wouldn't be too hard.

And thanks for that catch on the extra spaces- we should be trimming the GPU and CPU name. I'll put in a fix for that quick.

ss7m commented 4 years ago

Latest commit should fix the spacing issue

petterssonjonas commented 4 years ago

I think you broke it mate


                              fuze@fuzebox
                              ------------
              /\              OS: Arch Linux x86_64
             /  \             Kernel: 5.6.6-arch1-1
            /\   \            Uptime: 4 days, 8 hours, 25 mins
           /      \           Packages: 2024 (pacman)
          /   ,,   \          Shell: fish
         /   |  |  -\         Terminal: st-256color
        /_-''    ''-_\        CPU: Intel i7-8700K (12) @ 4.7GHz
                              GPU: GeForce GTX 1660 Ti
 free(): invalid pointer
 fish: “./paleofetch” terminated by signal SIGABRT (Abort)
ss7m commented 4 years ago

That’s what I get for hastily writing C code without properly testing it. I’ll revert that commit and get back to this tomorrow

ss7m commented 4 years ago

Latest commit should be a proper fix for this

ss7m commented 4 years ago

Latest commit adds disk usage, with two new functions get_disk_usage_root and get_disk_usage_home