Skip to content

Commit

Permalink
Fix LXQt detect issue by verifying that desktop_session is non-empty
Browse files Browse the repository at this point in the history
  • Loading branch information
hhannine committed Oct 21, 2020
1 parent be5b732 commit 49ba61a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
43 changes: 22 additions & 21 deletions superpaper/spanmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,30 @@ def set_spanmode():
winreg.SetValueEx(reg_key_desktop, "TileWallpaper", 0, winreg.REG_SZ, "0")
elif pltf == "Linux":
desk_env = os.environ.get("DESKTOP_SESSION")
if desk_env in ["gnome", "gnome-wayland",
"unity", "ubuntu",
"pantheon", "budgie-desktop",
"pop"]:
subprocess.run(["gsettings", "set",
"org.gnome.desktop.background", "picture-options",
"spanned"])
elif desk_env in ["cinnamon"]:
subprocess.run(["gsettings", "set",
"org.cinnamon.desktop.background", "picture-options",
"spanned"])
elif desk_env in ["mate"]:
subprocess.run(["gsettings", "set",
"org.mate.background", "picture-options",
"spanned"])
elif desk_env and (desk_env.lower() == "lubuntu" or "lxqt" in desk_env.lower()):
try:
subprocess.run(["pcmanfm", "--wallpaper-mode=stretch"])
except OSError:
if desk_env:
if desk_env in ["gnome", "gnome-wayland",
"unity", "ubuntu",
"pantheon", "budgie-desktop",
"pop"]:
subprocess.run(["gsettings", "set",
"org.gnome.desktop.background", "picture-options",
"spanned"])
elif desk_env in ["cinnamon"]:
subprocess.run(["gsettings", "set",
"org.cinnamon.desktop.background", "picture-options",
"spanned"])
elif desk_env in ["mate"]:
subprocess.run(["gsettings", "set",
"org.mate.background", "picture-options",
"spanned"])
elif desk_env.lower() == "lubuntu" or "lxqt" in desk_env.lower():
try:
subprocess.run(["pcmanfm-qt", "--wallpaper-mode=stretch"])
subprocess.run(["pcmanfm", "--wallpaper-mode=stretch"])
except OSError:
pass
try:
subprocess.run(["pcmanfm-qt", "--wallpaper-mode=stretch"])
except OSError:
pass
elif pltf == "Darwin":
# Mac support TODO
pass
Expand Down
2 changes: 1 addition & 1 deletion superpaper/wallpaper_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ def set_wallpaper_linux(outputfile):
outputfile])
elif desk_env in ["xfce", "xubuntu", "ubuntustudio"]:
xfce_actions(outputfile)
elif desk_env and (desk_env.lower() == "lubuntu" or "lxqt" in desk_env.lower()):
elif desk_env.lower() == "lubuntu" or "lxqt" in desk_env.lower():
try:
subprocess.run(["pcmanfm", "-w", outputfile])
except OSError:
Expand Down

0 comments on commit 49ba61a

Please sign in to comment.