Detect Flatpak via environment variable

This commit is contained in:
Micah Lee 2021-11-14 17:16:21 -08:00
parent a5893225fc
commit 54689eada8
2 changed files with 11 additions and 10 deletions

View file

@ -432,6 +432,12 @@ class Common:
r = random.SystemRandom()
return "-".join(r.choice(wordlist) for _ in range(word_count))
def is_flatpak(self):
"""
Returns True if OnionShare is running in a Flatpak sandbox
"""
return os.environ.get("FLATPAK_ID") == "org.onionshare.OnionShare"
@staticmethod
def random_string(num_bytes, output_len=None):
"""