[X] Split the main.c file into multiple files, inside something like a src folder.
[X] Remove the old_cupidfetch.c file, if you want the old version just use Git to get it.
[x] Define anything that does not change as const and maybe static.
[ ] Fix inconsistent styling with something like clang-format.
[x] Prefix global variables with something like g_.
[x] Avoid using popen for simple stuff like getting the shell which can be done with geteuid. For the package count, it looks fine to me tbh but there may be a better way of doing things.
[x] Be careful with null-terminated strings, or don't use them entirely. There is a potential bug in OS detection when parsing the ID= in which, if there is no newline, some UB may happen.
[x] When detecting desktop environment, you would iterate through all the processes and check the binary name.
main.c
file into multiple files, inside something like asrc
folder.old_cupidfetch.c
file, if you want the old version just use Git to get it.const
and maybestatic
.clang-format
.g_
.popen
for simple stuff like getting the shell which can be done withgeteuid
. For the package count, it looks fine to me tbh but there may be a better way of doing things.ID=
in which, if there is no newline, some UB may happen.