hhannine / superpaper

A cross-platform multi monitor wallpaper manager.
MIT License
1.12k stars 46 forks source link

Exception when DESKTOP_SESSION is empty. #4

Closed vyrus714 closed 5 years ago

vyrus714 commented 5 years ago

I'm on KDE, but my DESKTOP_SESSION variable is empty (likely because I don't use a display manager - just startx). I can get around this issue by using DESKTOP_SESSION="/usr/share/xsessions/plasma", but I thought it might be useful to know that this isn't being caught.

Relevant console output:

DESKTOP_SESSION is: 'None' Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "superpaper.pyw", line 1095, in spanSingleImagePPIcorrection setWallpaper(outputfile) File "superpaper.pyw", line 1153, in setWallpaper setWallpaper_linux(outputfile) File "superpaper.pyw", line 1212, in setWallpaper_linux elif "i3" in desk_env or desk_env in ["/usr/share/xsessions/bspwm"]: TypeError: argument of type 'NoneType' is not iterable

It could be useful to have a dropdown in the general settings for the known desktop environments for cases like these, so you don't have to modify the session variable.

hhannine commented 5 years ago

Thanks for reporting the issue. I tried to improve empty DESKTOP_SESSION handling but seems that I forgot to fix this exact issue.

Yes that's a good idea. I've been thinking along the lines that if the variable is empty at first launch, the app shows a dialog and asks which DE/WM it is running in, with a drop down menu of supported choices.

vyrus714 commented 3 years ago

Hey, I'm back! I appear to have run into this issue again, probably because my setup is a pretty niche side case where I don't use a display manager, so my DESKTOP_SESSION is never set. Because of this, it seems that it's falling back on trying to use feh, even though I'm using kde's plasma desktop, so that doesn't end up doing anything:

DESKTOP_SESSION is: 'None'
DESKTOP_SESSION variable is empty, attempting to use feh to set the wallpaper.

I did a little digging, and it looks like running_kde() function should actually work correctly, since KDE_FULL_SESSION is true, however it looks like that's being bypassed since the function is never called if DESKTOP_SESSION isn't set (line 1451 gets passed up because of line 1409).

For now I'm just going to throw in DESKTOP_SESSION=kde when running superpaper, as that causes everything to work just fine, but you probably want to just bump the kde check inline with the if desk_env: if-else block, since it looks like that will catch edge cases like this.