]>
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",
26 # Config file/commandline default values
27 # $WORK gets replaced with the actual value for args.work (which may be
28 # overridden on the commandline)
31 "work": "/var/lib/waydroid",
32 "vendor_type": "MAINLINE",
33 "system_datetime": "0",
34 "vendor_datetime": "0",
35 "preinstalled_images_paths": [
36 "/etc/waydroid-extra/images",
37 "/usr/share/waydroid-extra/images",
39 "suspend_action": "freeze"
41 defaults
["images_path"] = defaults
["work"] + "/images"
42 defaults
["rootfs"] = defaults
["work"] + "/rootfs"
43 defaults
["data"] = defaults
["work"] + "/data"
44 defaults
["lxc"] = defaults
["work"] + "/lxc"
45 defaults
["host_perms"] = defaults
["work"] + "/host-permissions"
48 "user_name": pwd
.getpwuid(os
.getuid()).pw_name
,
49 "user_id": str(os
.getuid()),
50 "group_id": str(os
.getgid()),
51 "host_user": os
.path
.expanduser("~"),
52 "pid": str(os
.getpid()),
53 "xdg_data_home": str(os
.environ
.get('XDG_DATA_HOME', os
.path
.expanduser("~") + "/.local/share")),
54 "xdg_runtime_dir": str(os
.environ
.get('XDG_RUNTIME_DIR')),
55 "wayland_display": str(os
.environ
.get('WAYLAND_DISPLAY')),
56 "pulse_runtime_path": str(os
.environ
.get('PULSE_RUNTIME_PATH')),
60 session_defaults
["config_path"] = defaults
["work"] + "/session.cfg"
61 session_defaults
["waydroid_data"] = session_defaults
["xdg_data_home"] + \
63 if session_defaults
["pulse_runtime_path"] == "None":
64 session_defaults
["pulse_runtime_path"] = session_defaults
["xdg_runtime_dir"] + "/pulse"
67 "config_path": "/usr/share/waydroid-extra/channels.cfg",
68 "system_channel": "https://ota.waydro.id/system",
69 "vendor_channel": "https://ota.waydro.id/vendor",
70 "rom_type": "lineage",
71 "system_type": "VANILLA"
73 channels_config_keys
= ["system_channel",