]>
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_paths": [
47 "/etc/waydroid-extra/images",
48 "/usr/share/waydroid-extra/images",
51 defaults
["images_path"] = defaults
["work"] + "/images"
52 defaults
["rootfs"] = defaults
["work"] + "/rootfs"
53 defaults
["data"] = defaults
["work"] + "/data"
54 defaults
["lxc"] = defaults
["work"] + "/lxc"
55 defaults
["host_perms"] = defaults
["work"] + "/host-permissions"
58 "user_name": pwd
.getpwuid(os
.getuid()).pw_name
,
59 "user_id": str(os
.getuid()),
60 "group_id": str(os
.getgid()),
61 "host_user": os
.path
.expanduser("~"),
62 "xdg_data_home": str(os
.environ
.get('XDG_DATA_HOME', os
.path
.expanduser("~") + "/.local/share")),
63 "xdg_runtime_dir": str(os
.environ
.get('XDG_RUNTIME_DIR')),
64 "wayland_display": str(os
.environ
.get('WAYLAND_DISPLAY')),
65 "pulse_runtime_path": str(os
.environ
.get('PULSE_RUNTIME_PATH')),
69 session_defaults
["config_path"] = defaults
["work"] + "/session.cfg"
70 session_defaults
["waydroid_data"] = session_defaults
["xdg_data_home"] + \
72 if session_defaults
["pulse_runtime_path"] == "None":
73 session_defaults
["pulse_runtime_path"] = session_defaults
["xdg_runtime_dir"] + "/pulse"
76 "config_path": "/usr/share/waydroid-extra/channels.cfg",
77 "system_channel": "https://ota.waydro.id/system",
78 "vendor_channel": "https://ota.waydro.id/vendor",
79 "rom_type": "lineage",
80 "system_type": "VANILLA"
82 channels_config_keys
= ["system_channel",