Skip to content

Commit 42b49f0

Browse files
committed
Fix bad/impossible conditions on if statements that were causing
incorrect DE detection 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 KittyKatt#782 (and possibly others)
1 parent e2ca5ae commit 42b49f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

screenfetch-dev

+3-3
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,7 @@ detectde () {
21042104
esac
21052105
fi
21062106

2107-
if [ -n "$DE" ]; then
2107+
if [[ ${DE} == "Not Present" ]]; then
21082108
# classic fallbacks
21092109
if [ -n "$KDE_FULL_SESSION" ]; then
21102110
DE="KDE"
@@ -2126,7 +2126,7 @@ detectde () {
21262126
fi
21272127
fi
21282128

2129-
if [[ -z "$DE" || "$DE" = "Not Present" ]]; then
2129+
if [[ "$DE" = "Not Present" ]]; then
21302130
# fallback to checking $DESKTOP_SESSION
21312131
local _DESKTOP_SESSION=
21322132
if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
@@ -2169,7 +2169,7 @@ detectde () {
21692169
esac
21702170
fi
21712171

2172-
if [ -n "$DE" ]; then
2172+
if [ ${DE} == "Not Present" ]; then
21732173
# fallback to checking $GDMSESSION
21742174
case "${GDMSESSION,,}" in
21752175
'lumina'*)

0 commit comments

Comments
 (0)