]>
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",
28 # Config file/commandline default values
29 # $WORK gets replaced with the actual value for args.work (which may be
30 # overridden on the commandline)
33 "work": "/var/lib/waydroid",
34 "vendor_type": "MAINLINE",
35 "system_datetime": "0",
36 "vendor_datetime": "0",
37 "preinstalled_images_paths": [
38 "/etc/waydroid-extra/images",
39 "/usr/share/waydroid-extra/images",
41 "suspend_action": "freeze",
42 "mount_overlays": "True",
44 "container_xdg_runtime_dir": "/run/xdg",
45 "container_wayland_display": "wayland-0",
47 defaults
["images_path"] = defaults
["work"] + "/images"
48 defaults
["rootfs"] = defaults
["work"] + "/rootfs"
49 defaults
["overlay"] = defaults
["work"] + "/overlay"
50 defaults
["overlay_rw"] = defaults
["work"] + "/overlay_rw"
51 defaults
["overlay_work"] = defaults
["work"] + "/overlay_work"
52 defaults
["data"] = defaults
["work"] + "/data"
53 defaults
["lxc"] = defaults
["work"] + "/lxc"
54 defaults
["host_perms"] = defaults
["work"] + "/host-permissions"
55 defaults
["container_pulse_runtime_path"] = defaults
["container_xdg_runtime_dir"] + "/pulse"
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 "pid": str(os
.getpid()),
63 "xdg_data_home": str(os
.environ
.get('XDG_DATA_HOME', os
.path
.expanduser("~") + "/.local/share")),
64 "xdg_runtime_dir": str(os
.environ
.get('XDG_RUNTIME_DIR')),
65 "wayland_display": str(os
.environ
.get('WAYLAND_DISPLAY')),
66 "pulse_runtime_path": str(os
.environ
.get('PULSE_RUNTIME_PATH')),
69 "background_start": "true"
71 session_defaults
["waydroid_data"] = session_defaults
["xdg_data_home"] + \
73 if session_defaults
["pulse_runtime_path"] == "None":
74 session_defaults
["pulse_runtime_path"] = session_defaults
["xdg_runtime_dir"] + "/pulse"
77 "config_path": "/usr/share/waydroid-extra/channels.cfg",
78 "system_channel": "https://ota.waydro.id/system",
79 "vendor_channel": "https://ota.waydro.id/vendor",
80 "rom_type": "lineage",
81 "system_type": "VANILLA"
83 channels_config_keys
= ["system_channel",