KittyKatt / screenFetch

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

Fix bad conditions on if statements that were causing false DE detection #787

Closed Peter0x44 closed 4 months ago

Peter0x44 commented 8 months ago

There are two instances of the condition: if [ -n "$DE" ]; then

I think if statements with this condition were ALWAYS running, because at the beginning of detectde () $DE gets initialized to "Not Present".

if [[ -z "$DE" || "$DE" = "Not Present" ]]; then

There was one instance of this, which I believe is supposed to have a "==" vs "=". The first part of the condition is also NEVER false, since $DE gets initialized to "Not Present", as mentioned before, so I just removed it.

Fixes #782 (and possibly others)

Peter0x44 commented 4 months ago

I've stopped using screenfetch and won't be working on this any further. If someone else wants to pick this up, please do.