]>
glassweightruler.freedombox.rocks Git - waydroid.git/blob - tools/config/__init__.py
1 # Copyright 2021 Oliver Smith
2 # SPDX-License-Identifier: GPL-3.0-or-later
9 from tools
.config
.load
import load
, load_channels
10 from tools
.config
.save
import save
13 # Exported variables (internal configuration)
16 tools_src
= os
.path
.normpath(os
.path
.realpath(__file__
) + "/../../..")
18 # Keys saved in the config file (mostly what we ask in 'waydroid init')
19 config_keys
= ["arch",
27 # Config file/commandline default values
28 # $WORK gets replaced with the actual value for args.work (which may be
29 # overridden on the commandline)
32 "work": "/var/lib/waydroid",
33 "vendor_type": "MAINLINE",
34 "system_datetime": "0",
35 "vendor_datetime": "0",
36 "preinstalled_images_paths": [
37 "/etc/waydroid-extra/images",
38 "/usr/share/waydroid-extra/images",
40 "suspend_action": "freeze",
41 "mount_overlays": "True",
43 defaults
["images_path"] = defaults
["work"] + "/images"
44 defaults
["rootfs"] = defaults
["work"] + "/rootfs"
45 defaults
["overlay"] = defaults
["work"] + "/overlay"
46 defaults
["overlay_rw"] = defaults
["work"] + "/overlay_rw"
47 defaults
["overlay_work"] = defaults
["work"] + "/overlay_work"
48 defaults
["data"] = defaults
["work"] + "/data"
49 defaults
["lxc"] = defaults
["work"] + "/lxc"
50 defaults
["host_perms"] = defaults
["work"] + "/host-permissions"
53 "user_name": pwd
.getpwuid(os
.getuid()).pw_name
,
54 "user_id": str(os
.getuid()),
55 "group_id": str(os
.getgid()),
56 "host_user": os
.path
.expanduser("~"),
57 "pid": str(os
.getpid()),
58 "xdg_data_home": str(os
.environ
.get('XDG_DATA_HOME', os
.path
.expanduser("~") + "/.local/share")),
59 "xdg_runtime_dir": str(os
.environ
.get('XDG_RUNTIME_DIR')),
60 "wayland_display": str(os
.environ
.get('WAYLAND_DISPLAY')),
61 "pulse_runtime_path": str(os
.environ
.get('PULSE_RUNTIME_PATH')),
64 "background_start": "true"
66 session_defaults
["config_path"] = defaults
["work"] + "/session.cfg"
67 session_defaults
["waydroid_data"] = session_defaults
["xdg_data_home"] + \
69 if session_defaults
["pulse_runtime_path"] == "None":
70 session_defaults
["pulse_runtime_path"] = session_defaults
["xdg_runtime_dir"] + "/pulse"
73 "config_path": "/usr/share/waydroid-extra/channels.cfg",
74 "system_channel": "https://ota.waydro.id/system",
75 "vendor_channel": "https://ota.waydro.id/vendor",
76 "rom_type": "lineage",
77 "system_type": "VANILLA"
79 channels_config_keys
= ["system_channel",