KittyKatt / screenFetch

Fetches system/theme information in terminal for Linux desktop screenshots.
GNU General Public License v3.0
3.82k stars 453 forks source link

WSL2 Ubuntu 20.04 no X - unable to open display #715

Open ssonnenwald opened 3 years ago

ssonnenwald commented 3 years ago

I'm submitting a ... (check one with "x")

[x] bug report
[ ] new distro request

Bug report Screenfetch(version 3.9.1) -- When DISPLAY has an ip on a WSL2 Unbuntu 20.04 without X then screenfetch just hangs for awhile then prints xdpyinfo: unable to open display "xxxxxxx" -- If I export DISPLAY="" then it works fine.

Distro name: Homepage: Distro logo: Package manager:

Show us the output of => lsb_release -sirc => cat /etc/os-release => ls -1 /etc/*-release Ubuntu 20.04 focal

ssonnenwald commented 3 years ago

Maybe try something like this:

x_works(){

If there is no xdpyinfo

 # Bash will return 127
 # If X cant connect, it returns 1
 # If X can connect, it returns 0
 xdpyinfo 1>/dev/null 2>&1
 WORKS="$?"
 return $WORKS

}

if x_works; then

polluks commented 1 year ago

By the way WSL1 says:


awk: fatal: cannot open file `/proc/fb' for reading (No such file or directory)