ss7m / paleofetch

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

(WIP) Bedrock Linux Support #59

Open Titaniumtown opened 4 years ago

Titaniumtown commented 4 years ago

Ok, I am new to C so be easy on me (that's also why my code is messy), lol. I did everything to add bedrock linux support, but I just don't now how I could implement multiple logos with the main function in paleofetch.c help needed!

I also stole the ascii art from neofetch.

ss7m commented 4 years ago

What is in the /bedrock/etc/or-release file? How does it differ from the regulr /etc/os-resease file? I'm not really familiar with bedrock linux

otreblan commented 4 years ago

I was thinking of adding a CMake option for each distro but my PR was closed.

5

Titaniumtown commented 4 years ago

@sam-barr that shows what bedrock linux version you're on. /etc/os-release shows the default linux distro running over top of bedrock linux.

Titaniumtown commented 4 years ago

@otreblan I don't think that's related to this PR though. Maybe put that in Issues?

Titaniumtown commented 4 years ago

@sam-barr have any idea how I could implement multiple logos in the main function?

otreblan commented 4 years ago

60

ss7m commented 4 years ago

As it stands now the logo is decided at compile time, and I'm not really looking to change that behavior at the moment.

allisio (not sure how to tag them in this) has written some stuff w.r.t package managers which includes logic based on the distro. If/when they make a pull request with that this extra business with bedrock linux could probably be added onto that.

Titaniumtown commented 4 years ago

My current code seems to not work. It compiles, but when I run it, it crashes. Can anyone else reproduce the issue? is it a simple mistake? I am new to C

Titaniumtown commented 4 years ago

wrong button, lol

dwzg commented 4 years ago

So the logo part is still not working and I think it get's quite complicated and needs rethinking and some code changes. Maybe it would be best to narrow this pull request down to only add the bedrock name stuff and tackle the integration of other logos later?

Titaniumtown commented 4 years ago

Would I just close the PR and create 2 new ones?

Titaniumtown commented 4 years ago

Has anyone figured out how the logo can be decided on run time?

Titaniumtown commented 4 years ago

I really want multi-os support!

Titaniumtown commented 4 years ago

Bump. Anyone think of any ideas to fix this issue?

otreblan commented 4 years ago

image Because LOGO is a pointer, COUNT() is returning 64/64=1. ARCH_LOGO instead is an array so it return the correct value.

otreblan commented 4 years ago

image When using a #define, COUNT() returns the correct value. @Titaniumtown

Titaniumtown commented 4 years ago

Oh cool! Thanks for the info!

Titaniumtown commented 4 years ago

can someone check out my code so far? it works for me.

Titaniumtown commented 4 years ago

Oh, also I have to add in the color neofetch uses for bedrock.

Titaniumtown commented 4 years ago

How would I do that?

otreblan commented 4 years ago

How would I do that?

Change CFLAGS in the Makefile. Edit: I tought this was for the #define

Titaniumtown commented 4 years ago

what do you mean? I have to add in the colors that neofetch uses for bedrock. That's something to do with printing text, right?

otreblan commented 4 years ago

https://en.m.wikipedia.org/wiki/ANSI_escape_code

Titaniumtown commented 4 years ago

I added initial multi-package manager support (just dpkg and pacman atm) and inital coloring of the bedrock logo.

Titaniumtown commented 4 years ago

I need to figure out how to speed up checking for all the package managers.

Titaniumtown commented 4 years ago

Right now, my branch is about 10x slower than the master branch. It's all mostly due to package manager recognition.

Titaniumtown commented 4 years ago

When you enable caching the package info, paleofetch becomes about the same speed as the master branch.

Titaniumtown commented 4 years ago

One thing I found is that if I have 2 statums (on bedrock linux) of distros that use the same package manager, it only uses one of them to do the count.

allisio commented 4 years ago

Caching the package count probably shouldn't be the default behavior. It's a dynamic value that changes pretty often.

Titaniumtown commented 4 years ago

Yea, but paleofetch is super slow when you don't. I'm getting about 8-20 ms w/ caching, and 400-600 ms w/o caching.

allisio commented 4 years ago

Then you're essentially breaking the build. Just my two cents.

Titaniumtown commented 4 years ago

There has to be a faster way of looking for packages. Like paleofetch, is slow, not at the same level as neofetch, but slow nonetheless.

Titaniumtown commented 4 years ago

Maybe it can be parallelized?

ss7m commented 4 years ago

In the packages branch, @allisio and I implemented querying the package database in parallel, you might be able to look at that for ideas.

Titaniumtown commented 4 years ago

I just pushed a commit, it seems not to run, anyone know why? It's something to do with the logo.

Titaniumtown commented 4 years ago

Currently it compiles correctly, everything is in place except for the LOGO variable being set per-OS.

Titaniumtown commented 4 years ago

Maybe this PR could just be about multiple package managers?

Titaniumtown commented 4 years ago

Oh, almost forgot. I need to add support for multiple stratums that use the same package manager. ex ubuntu 2004 and ubuntu 1804

Titaniumtown commented 4 years ago

Does anyone have any ideas on how to fix the issue with having multiple logos?

jake-87 commented 3 years ago

Hmm. Where is the LOGO string actually declared? We could replace that declaration with a function that first checks if the user has specified a logo, then if they have not, check a file like /etc/os-release to declare the logo?