summaryrefslogtreecommitdiff
path: root/qutebrowser/utils
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-23 22:42:57 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-23 22:42:57 +0100
commit74c9f66752f077c4b94927c15aec801a1ab88a22 (patch)
tree655dde056aaaed5a0c4b1776cba5856d22a90971 /qutebrowser/utils
parent5e4b1ffc0b897df36595db51c3b1920703c6e1b6 (diff)
downloadqutebrowser-74c9f66752f077c4b94927c15aec801a1ab88a22.tar.gz
qutebrowser-74c9f66752f077c4b94927c15aec801a1ab88a22.zip
standarddir: Fix custom basedirs with flatpak
See https://github.com/flathub/org.qutebrowser.qutebrowser/issues/18#issuecomment-802827816
Diffstat (limited to 'qutebrowser/utils')
-rw-r--r--qutebrowser/utils/standarddir.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/qutebrowser/utils/standarddir.py b/qutebrowser/utils/standarddir.py
index 7bb632b57..c1ba0a73e 100644
--- a/qutebrowser/utils/standarddir.py
+++ b/qutebrowser/utils/standarddir.py
@@ -232,16 +232,15 @@ def _init_runtime(args: Optional[argparse.Namespace]) -> None:
# Unfortunately this path could get too long for sockets (which have a
# maximum length of 104 chars), so we don't add the username here...
- if version.is_flatpak():
- # We need a path like /run/user/1000/app/org.qutebrowser.qutebrowser rather than
- # /run/user/1000/qutebrowser on Flatpak, since that's bind-mounted in a way that
- # it is accessible by any other qutebrowser instances.
- *parts, app_name = os.path.split(path)
- assert app_name == APPNAME, app_name
- path = os.path.join(*parts, 'app', os.environ['FLATPAK_ID'])
- else:
- _create(path)
+ if version.is_flatpak():
+ # We need a path like /run/user/1000/app/org.qutebrowser.qutebrowser rather than
+ # /run/user/1000/qutebrowser on Flatpak, since that's bind-mounted in a way that
+ # it is accessible by any other qutebrowser instances.
+ *parts, app_name = os.path.split(path)
+ assert app_name == APPNAME, app_name
+ path = os.path.join(*parts, 'app', os.environ['FLATPAK_ID'])
+ _create(path)
_locations[_Location.runtime] = path