diff options
author | Micah Lee <micah@micahflee.com> | 2020-06-30 14:18:59 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2020-06-30 14:18:59 -0700 |
commit | aa60123cf306ff8d04ee17504776e22fb7163af2 (patch) | |
tree | 0b767e3efd993daec36e49765adc8d126aadcafc /onionshare_gui | |
parent | a5fa83ca0c0a08ac919ce27f8fd2f47e82b3ab9f (diff) | |
download | onionshare-aa60123cf306ff8d04ee17504776e22fb7163af2.tar.gz onionshare-aa60123cf306ff8d04ee17504776e22fb7163af2.zip |
Add flatpak detection
Diffstat (limited to 'onionshare_gui')
-rw-r--r-- | onionshare_gui/gui_common.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/onionshare_gui/gui_common.py b/onionshare_gui/gui_common.py index 4b8fe5d4..7eb4f0e8 100644 --- a/onionshare_gui/gui_common.py +++ b/onionshare_gui/gui_common.py @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ import os +import json from onionshare import strings from onionshare.onion import Onion @@ -37,6 +38,18 @@ class GuiCommon: self.qtapp = qtapp self.local_only = local_only + # Are we running in a flatpak package? + self.is_flatpak = False + if os.path.exists("/app/manifest.json"): + try: + with open("/app/manifest.json") as f: + manifest_data = json.loads(f.read()) + if manifest_data["id"] == "org.onionshare.OnionShare": + self.is_flatpak = True + self.common.log("GuiCommon", "__init__", "is_flatpak=True") + except: + pass + # Load settings self.common.load_settings() |