Skip to content

Commit

Permalink
If DESKTOP_SESSION variable is empty, attempt to use feh backend as d…
Browse files Browse the repository at this point in the history
…efault.

Assuming that DESKTOP_SESSION is empty mostly on tiling WM setups where feh is commonplace.
  • Loading branch information
hhannine committed May 20, 2019
1 parent 59b30ab commit c936748
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions superpaper.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -1205,17 +1205,21 @@ def setWallpaper_linux(outputfile):
subprocess.run("pcmanfm-qt", "-w", outputfile)
except:
g_logger.info("Exception: failure to find either command \
'pcmanfm' or 'pcmanfm-qt'. Exiting.")
'pcmanfm' or 'pcmanfm-qt'. Exiting.")
sys.exit(1)
elif desk_env in ["/usr/share/xsessions/plasma"]:
kdeplasma_actions(outputfile)
elif "i3" in desk_env or desk_env in ["/usr/share/xsessions/bspwm"]:
subprocess.run(["feh", "--bg-scale", "--no-xinerama", outputfile])
elif desk_env == "":
g_logger.info("DESKTOP_SESSION variable is empty, \
attempting to use feh to set the wallpaper.")
subprocess.run(["feh", "--bg-scale", "--no-xinerama", outputfile])
else:
if set_command == "":
message = "Your DE could not be detected to set the wallpaper. \
You need to set the 'set_command' option in your \
settings file superpaper/general_settings. Exiting."
You need to set the 'set_command' option in your \
settings file superpaper/general_settings. Exiting."
g_logger.info(message)
show_message_dialog(message, "Error")
sys.exit(1)
Expand Down

0 comments on commit c936748

Please sign in to comment.