]>
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_session
, load_channels
10 from tools
.config
.save
import save
, save_session
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",
25 session_config_keys
= ["user_name",
37 # Config file/commandline default values
38 # $WORK gets replaced with the actual value for args.work (which may be
39 # overridden on the commandline)
42 "work": "/var/lib/waydroid",
43 "vendor_type": "MAINLINE",
44 "system_datetime": "0",
45 "vendor_datetime": "0",
46 "preinstalled_images_path": "/usr/share/waydroid-extra/images"
48 defaults
["images_path"] = defaults
["work"] + "/images"
49 defaults
["rootfs"] = defaults
["work"] + "/rootfs"
50 defaults
["data"] = defaults
["work"] + "/data"
51 defaults
["lxc"] = defaults
["work"] + "/lxc"
52 defaults
["host_perms"] = defaults
["work"] + "/host-permissions"
55 "user_name": pwd
.getpwuid(os
.getuid()).pw_name
,
56 "user_id": str(os
.getuid()),
57 "group_id": str(os
.getgid()),
58 "host_user": os
.path
.expanduser("~"),
59 "xdg_data_home": str(os
.environ
.get('XDG_DATA_HOME', os
.path
.expanduser("~") + "/.local/share")),
60 "xdg_runtime_dir": str(os
.environ
.get('XDG_RUNTIME_DIR')),
61 "wayland_display": str(os
.environ
.get('WAYLAND_DISPLAY')),
62 "pulse_runtime_path": str(os
.environ
.get('PULSE_RUNTIME_PATH')),
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://raw.githubusercontent.com/waydroid/OTA/master/system",
75 "vendor_channel": "https://raw.githubusercontent.com/waydroid/OTA/master/vendor",
76 "rom_type": "lineage",
77 "system_type": "VANILLA"
79 channels_config_keys
= ["system_channel",