ss7m / paleofetch

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

Error of failed request: BadWindow #38

Closed adityaarun1 closed 4 years ago

adityaarun1 commented 4 years ago

Hi, I get the following error when running paleofetch. I am currently on the latest commit.

Screenshot from 2020-04-24 10-06-54

[Edit] The issue occurs in the get_terminal call. Commenting out that line resolves the issue. I am using gnome-terminal if that helps.

allisio commented 4 years ago

Hello. Could you show the results of running xprop -root _NET_ACTIVE_WINDOW on your system?

adityaarun1 commented 4 years ago

Here you go. Screenshot from 2020-04-24 13-07-23

allisio commented 4 years ago

Well, that's definitely the problem; that request shouldn't be returning the root window.

Doing a search for gnome-terminal _NET_ACTIVE_WINDOW returns plenty of results wherein people use/recommend this feature to get the controlling terminal, so either there's been a recent change to GNOME (that stops gnome-terminal instances from being mapped?!) or something unorthodox about your configuration.

I'm afraid I don't know how best to proceed in resolving this issue. :/

Edit: Other than resorting to the fallback if window is 0 after the property request, which would in fact return exactly the right value in this case.

adityaarun1 commented 4 years ago

Oh, sorry to hear that.

FWIW I am using wayland instead of X. Not sure if this is that unorthodox or the cause of the problem. Also, neofetch successfully shows my terminal.

allisio commented 4 years ago

FWIW, from the very top of the README:

Currently only supports Linux and Xorg.

neofetch shows your terminal by reading the TERM environment variable, which is currently what paleofetch resorts to doing if it can't open an X display. The fact that you hit this snag means that it was able to open one, so presumably you're actually using XWayland.

In any case, resolving this particular issue now appears to be pretty straightforward.

adityaarun1 commented 4 years ago

Right, my bad. I'll try to make this script generalizable to wayland too. Thanks.