Skip to content

Commit

Permalink
Close #153 Open GUI in WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
FeodorFitsner committed Aug 6, 2022
1 parent 3121df5 commit 7b83fa7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sdk/python/flet/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ def is_linux():


def is_linux_server():
return (
platform.system() == "Linux" and os.environ.get("XDG_CURRENT_DESKTOP") == None
)
if platform.system() == "Linux":
# check if it's WSL
p = "/proc/version"
if os.path.exists(p):
with open(p, "r") as file:
if "microsoft" in file.read():
return False # it's WSL, not a server
return os.environ.get("XDG_CURRENT_DESKTOP") == None
return False


def is_macos():
Expand Down

0 comments on commit 7b83fa7

Please sign in to comment.