LivacoNew / CrabFetch

Extremely fast, featureful and customizable command-line fetcher.
Apache License 2.0
21 stars 4 forks source link

Improve detection in WSL #17

Closed CarterLi closed 3 months ago

CarterLi commented 4 months ago

image

  1. crabfetch fails to detect the resolution and refresh rate, while wayland-info reports it correctly
    interface: 'wl_output',                                  version:  3, name: 11
        x: 0, y: 0, scale: 1,
        physical_width: 0 mm, physical_height: 0 mm,
        make: 'weston', model: 'rdp',
        subpixel_orientation: unknown, output_transform: normal,
        mode:
                width: 2560 px, height: 1440 px, refresh: 60.000 Hz,
                flags: current preferred
  2. Host is reported as Unknown. Since WSL is a virtual machine, report WSL should be OK.
  3. WSL does't have desktop environment.
  4. Terminal is reported as init. I thinks crabfetch incorrectly detect /sbin/init as terminal.
  5. Although WSL can use systemd, it's not enabled in my machine. It should report init as detected by the terminal readout.
LivacoNew commented 4 months ago

I don't care about WSL tbh, I only care about actual Linux distros and not Window's weird emulation frankenstein of it.
The only thing here I actually care about is the resolution failure, and that's only because your pointing out that wayland-info is working. This means that there's a valid wayland compositor that somehow CrabFetch can't connect to. Please try to disable suppressed errors and let me know what it says.

As for the rest;

Host is reported as Unknown. Terminal is reported as init.

All of this is WSL specific stuff, therefore I don't care.

WSL does't have desktop environment.

Hence why it reports as unknown?

Although WSL can use systemd, it's not enabled in my machine.

Check what /sbin/init symlinks to, as that's how CrabFetch detects the init system.

CarterLi commented 4 months ago

I don't care about WSL tbh

LivacoNew commented 3 months ago

Had to install a Windows 11 VM for some ETS modding stuff a few days ago, so have decided to re-open this for better support while I have it. Here's how support looks right now from latest 3b2676f;

image

To-Fix:

CarterLi commented 3 months ago

GPU is missing Init system is wrong

LivacoNew commented 3 months ago

GPU is missing

This is probably just cus it's a VM? Don't have any bare metal Windows machines to test otherwise, and lspci reveals no GPU-looking devices attached.

image

Init system is wrong

Shouldn't be, systemd is apparently the default & your FastFetch is also reporting systemd

image

CarterLi commented 3 months ago

systemd in WSL is optional. You can disable it in /etc/wsl.conf

LivacoNew commented 3 months ago

systemd in WSL is optional. You can disable it in /etc/wsl.conf

I'm replicating this now, ty.

LivacoNew commented 3 months ago

Most issues seem to now be fixed from my testing, still got the useless mounts but that's a general CrabFetch problem that I still need to fix by blocking non-physical device mounts (will likely do later tonight after I post this comment)

image

Some notes just to clear up confusion;

Will leave this issue open until the mounts are fixed, hopefully soon. Will close via the mounts commit once it has been done.

LivacoNew commented 3 months ago

image

CarterLi commented 3 months ago

Init system version is unknown as it's Window's own stuff.

This suggests that you don't know what sysvinit is. You didn't even have the basic knowledge of what is init system used for, hence you looked for /sbin/init instead of looking for pid 1.

Please learn things carefully before copying features from fastfetch.

LivacoNew commented 3 months ago

This suggests that you don't know what sysvinit is. You didn't even have the basic knowledge of what is init system used for

Correct, while I knew about the basics of an init system, I didn't know what sysvinit was nor that the init system was guaranteed to run as PID 0. I've only been using Linux for about a year and, as I've said to you many times, have only been delving into it's low-levelness for a few months as a result of this project which was initially only to learn Rust. Your wording this like it's supposed to be an insult to me somehow?

Please learn things carefully before copying features from fastfetch.

I didn't "copy" this detection from FastFetch, if you look in the impl you can see where I actually got it from.

image

Don't assume I copy straight from your project. I find it much more interesting to research and find stuff out myself, only using other projects as last ditch resort to know where to look for myself (which I rarely let myself do).

CarterLi commented 3 months ago

Your wording this like it's supposed to be an insult to me somehow?

I was telling the truth.

I didn't "copy" this detection from FastFetch, if you look in the impl you can see where I actually got it from.

Yeah I knew it. I didn't say you copy code from fastfetch but I said features. Fastfetch uses pid 1 from day one. If you copied code from fastfetch you would have did it correctly.

Chassis detection is another feature you copied from fastfetch. Am I correct?

LivacoNew commented 3 months ago

I was telling the truth.

Mhm, in a condescending way.

Chassis detection is another feature you copied from fastfetch. Am I correct?

Yes, I got the idea from the FastFetch module. But, and this isn't an attempt at aggression, but what's the problem with doing so that you have to make a point out of it..? Fetch scripts can't really do much in the way of originality I'm afraid, your going to see copying from one fetch script to the other, and I'm not the only one that does it.

CarterLi commented 3 months ago

Fetch scripts can't really do much in the way of originality I'm afraid, your going to see copying from one fetch script to the other, and I'm not the only one that does it.

Correct. Most features of fastfetch are copied from neofetch. What makes me feel bad is that you copied features from fastfetch, with things done completely wrong, and shouted FASTFETCH IS YUCKY AND MINE IS FASTER. Please don't do that.

LivacoNew commented 3 months ago

First off, I am sorry if I've made you feel bad. I'm aware my writing style makes me sound naturally aggressive, which combined with my push for CrabFetch may make it seem worse. But, please do trust me when I say I don't intend to be. It's something I'm aware of but unfortunately can't help. Same applies for describing FastFetch as "yucky", I don't actually think it's bad at all, It's mostly just that personally I don't find it as intuitive or easy to use as others. It was added as an off-handed opinion of mine to help answer the question in the FAQ, nothing more. I'll change the wording after this I post this reply. I will keep advertising CrabFetch as being faster however. It's one of my prouder points in this project and, unlike my description of FastFetch, there are benchmarks to prove it at least.

As for doing things completely wrong, I can't really say anything other than to redirect you to my previous comments, in that I'm still learning all this stuff and don't want to just go copy and pasting other peoples implementations. CrabFetch is still unstable and very broken, I know. I also understand why it may be frustrating. Unfortunately, it takes time to figure out how to things better, and this project's helping with that at least.

CarterLi commented 3 months ago

It's one of my prouder points in this project and, unlike my description of FastFetch, there are benchmarks to prove it at least.

How? By parsing kscreen-doctor and xrandr? What if I didn't tell you that?

Everytime I post my benchmark result, I can always point out that which module of crab is the bottleneck and how it can be improved. While you just paste a screenshot running on your machine, and say crab is faster, EVEN BEFORE YOU GOT RID OF THE KSCREEN_DOCTOR AND XRANDR STUFF. How can it be persuasive?

LivacoNew commented 3 months ago

What if I didn't tell you that?

Then I would have kept ignorantly doing it, and hence why I'm happy to have you reporting issues & helping on this project <3