dylanaraps / neofetch

🖼️ A command-line system information tool written in bash 3.2+
MIT License
22.18k stars 1.66k forks source link

With WSL2 when $DISPLAY is set, Theme and Icons takes minutes to complete #1885

Open dotnetCarpenter opened 3 years ago

dotnetCarpenter commented 3 years ago

Description

With $DISPLAY unset, neofetch takes around 2 seconds on my machine.

With $DISPLAY set, neofetch always takes more than 6 minutes (did 3 test runs).

My DISPLAY variable below which expands to 172.28.16.1:0 (the Windows host's IP address):

export DISPLAY="`sed -n 's/nameserver //p' /etc/resolv.conf`:0"

Neofetch version

Neofetch 7.1.0 - installed via sudo make install

Screenshot

With $DISPLAY unset:

image

With $DISPLAY set:

image

Config file

https://gist.github.com/dotnetCarpenter/f118225f18ada0409aa1327672d4cfa6#file-config-conf

Verbose log

https://gist.github.com/dotnetCarpenter/f118225f18ada0409aa1327672d4cfa6#file-neofetchlog-log

  1. Run neofetch -vv 2> neofetchlog
  2. Upload the contents of neofetchlog to pastebin, gist or equivalent.
dylanaraps commented 3 years ago

Any reason why DISPLAY is set?

dotnetCarpenter commented 3 years ago

I need to run a python3 script that uses python3-tk. I found a Microsoft Tech article about installing VcXsrv Windows X Server and used that approach to get Baseline-JPEG-Decoder working.

dotnetCarpenter commented 3 years ago

There is a newer approach but unfortunately it is Windows 11 only. It's unclear if the newer approach sets DISPLAY.

Also notice that the speed-up in the first case where $DISPLAY is unset, is because neofetch simply does not query for Theme and Icons.

EDIT: It also fetches the GPU (which seems to be a false positive in this case). My actual GPUs are:

dotnetCarpenter commented 3 years ago

Hmmm just a observation that might be useful

After downgrading my GPU 1 driver (AMD), neofetch became super fast! On second thought - this is the Ubuntu package neofetch.

$ unset DISPLAY && time neofetch
            .-/+oossssoo+/-.               dotnet@DESKTOP-NDR7PBQ
        `:+ssssssssssssssssss+:`           ----------------------
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 21.04 on Windows 10 x86_64
    .ossssssssssssssssssdMMMNysssso.       Kernel: 5.10.16.3-microsoft-standard-WSL2
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 2 mins
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 1768 (dpkg)
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.1.4
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Terminal: Windows Terminal
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   CPU: Intel i7-4510U (4) @ 2.593GHz
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   GPU: 7021:00:00.0 Microsoft Corporation Device 008e
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Memory: 69MiB / 3931MiB
+sssshhhyNMMNyssssssssssssyNMMMysssssss+
.ssssssssdMMMNhsssssssssshNMMMdssssssss.
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
  +sssssssssdmydMMMMMMMMddddyssssssss+
   /ssssssssssshdmNNNNmyNMMMMhssssss/
    .ossssssssssssssssssdMMMNysssso.
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.

real    0m0.278s
user    0m0.175s
sys     0m0.097s

Note that GPU is now defined whereas it was not before. This version of neofetch is my Ubuntu 21.04 package, which might explain the speedup.

Package: neofetch
Version: 7.1.0-2
Priority: optional
Section: universe/utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 359 kB
Recommends: chafa
Homepage: https://github.com/dylanaraps/neofetch
Task: lubuntu-desktop, ubuntu-mate-core, ubuntu-mate-desktop
Download-Size: 81.3 kB
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages