]>
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",
26 session_config_keys
= ["user_name",
38 # Config file/commandline default values
39 # $WORK gets replaced with the actual value for args.work (which may be
40 # overridden on the commandline)
43 "work": "/var/lib/waydroid",
44 "vendor_type": "MAINLINE",
45 "system_datetime": "0",
46 "vendor_datetime": "0",
47 "preinstalled_images_paths": [
48 "/etc/waydroid-extra/images",
49 "/usr/share/waydroid-extra/images",
51 "suspend_action": "freeze"
53 defaults
["images_path"] = defaults
["work"] + "/images"
54 defaults
["rootfs"] = defaults
["work"] + "/rootfs"
55 defaults
["data"] = defaults
["work"] + "/data"
56 defaults
["lxc"] = defaults
["work"] + "/lxc"
57 defaults
["host_perms"] = defaults
["work"] + "/host-permissions"
60 "user_name": pwd
.getpwuid(os
.getuid()).pw_name
,
61 "user_id": str(os
.getuid()),
62 "group_id": str(os
.getgid()),
63 "host_user": os
.path
.expanduser("~"),
64 "xdg_data_home": str(os
.environ
.get('XDG_DATA_HOME', os
.path
.expanduser("~") + "/.local/share")),
65 "xdg_runtime_dir": str(os
.environ
.get('XDG_RUNTIME_DIR')),
66 "wayland_display": str(os
.environ
.get('WAYLAND_DISPLAY')),
67 "pulse_runtime_path": str(os
.environ
.get('PULSE_RUNTIME_PATH')),
71 session_defaults
["config_path"] = defaults
["work"] + "/session.cfg"
72 session_defaults
["waydroid_data"] = session_defaults
["xdg_data_home"] + \
74 if session_defaults
["pulse_runtime_path"] == "None":
75 session_defaults
["pulse_runtime_path"] = session_defaults
["xdg_runtime_dir"] + "/pulse"
78 "config_path": "/usr/share/waydroid-extra/channels.cfg",
79 "system_channel": "https://ota.waydro.id/system",
80 "vendor_channel": "https://ota.waydro.id/vendor",
81 "rom_type": "lineage",
82 "system_type": "VANILLA"
84 channels_config_keys
= ["system_channel",