Compare commits
3 Commits
78eecfc81a
...
72b477381f
| Author | SHA1 | Date | |
|---|---|---|---|
| 72b477381f | |||
| e8d8429bc9 | |||
| afe8d29340 |
@@ -8,5 +8,6 @@ def add_parser(sp: ap._SubParsersAction[ap.ArgumentParser]):
|
||||
dest="show",
|
||||
required=True,
|
||||
)
|
||||
show_sp.add_parser("config", help="show details about your configuration. Alias of config show")
|
||||
pkgs = show_sp.add_parser("pkgs", help="show details on package presets")
|
||||
pkgs.add_argument("show_pkg")
|
||||
|
||||
@@ -8,3 +8,6 @@ def config(args: argparse.Namespace, config: ArchMgrConfig):
|
||||
Your config can be found at
|
||||
""")
|
||||
print(config)
|
||||
elif args.conf_update == "pkgs":
|
||||
print("Updating config's package list")
|
||||
# TODO: Config saver
|
||||
|
||||
+10
-2
@@ -58,11 +58,15 @@ def default_config() -> ArchMgrConfig:
|
||||
"font": "Comfortaa 11",
|
||||
"gtk": "Adaptive-Theme",
|
||||
"qt": "gtk3",
|
||||
"icon_theme": "candy-icons"
|
||||
},
|
||||
"icon_theme": "candy-icons",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
requires_list: list[str] = []
|
||||
source_list = {} # for each setting, in which files it appears
|
||||
|
||||
|
||||
def load_config(file: str) -> ArchMgrConfig:
|
||||
"""Load the configuration from the specified file path
|
||||
|
||||
@@ -72,6 +76,7 @@ def load_config(file: str) -> ArchMgrConfig:
|
||||
Returns:
|
||||
The loaded, validated and parsed config
|
||||
"""
|
||||
global requires_list, source_list
|
||||
# Load and validate initial config
|
||||
try:
|
||||
loaded_conf = _load_config_file(file)
|
||||
@@ -82,6 +87,9 @@ def load_config(file: str) -> ArchMgrConfig:
|
||||
|
||||
configuration = cast(dict[str, Any], loaded_conf)
|
||||
requires = cast(list[str], configuration.pop("requires"))
|
||||
|
||||
# Keep track of all files
|
||||
requires_list += requires
|
||||
conf = cast(ArchMgrConfig, configuration)
|
||||
|
||||
# Recursively load files
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
def update_users_and_groups():
|
||||
pass
|
||||
@@ -8,18 +8,26 @@
|
||||
- Retrieve explicitly installed packages and remove those that are not present in goal and install those that are not present in current state
|
||||
|
||||
|
||||
# Concept for updating config automatically
|
||||
1. Track which files contain the setting
|
||||
2. If there are multiple and is no array, then simply overwrite the last
|
||||
3. If there are multiple and is array, then remove from the file where it is present and add to last file in requires list
|
||||
-> To enable this, update the loader to keep more metadata (list of all requires, list of files for each setting)
|
||||
|
||||
|
||||
# Ideas
|
||||
- [ ] function to collect new configs
|
||||
- [ ] config options for users and groups
|
||||
- [X] function to collect new configs -> Not smart because templates
|
||||
- [X] config options for users and groups
|
||||
- [ ] presets for things like desktops (like Hyprland)
|
||||
- [ ] config options for the template rendering
|
||||
- [ ] config options for themes
|
||||
- [ ] grub config
|
||||
- [ ] Dynamic selection of more configs (i.e. require syntax)
|
||||
- [ ] Own config syntax?
|
||||
- [X] Own config syntax? -> just use yaml
|
||||
- [ ] Autocompletion
|
||||
- [ ] Basic arch install how? -> Probably manual (or semi-automatic)
|
||||
- [ ] Mounts?
|
||||
- [ ] Conditional require
|
||||
|
||||
|
||||
# REGEX
|
||||
|
||||
Reference in New Issue
Block a user