Use correct runtime path for Flatpak

See #6300

Independent from the implementation on master, due to the circular
import workaround.
This commit is contained in:
Florian Bruhin 2021-03-18 08:46:25 +01:00
parent b246fb383b
commit 9f67a763ef
1 changed files with 8 additions and 1 deletions

View File

@ -232,7 +232,14 @@ 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...
_create(path)
from qutebrowser.utils import version
if version.is_sandboxed():
*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)
_locations[_Location.runtime] = path