From 6f3df98123dbfd90a91cba6a8bc0b0b6cb19f5b5 Mon Sep 17 00:00:00 2001 From: cswimr Date: Mon, 23 Dec 2024 01:24:59 -0500 Subject: [PATCH] delete fontconfig file in upd alias --- config/xonsh/aliases.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/xonsh/aliases.py b/config/xonsh/aliases.py index 45e8ecd..cef3d26 100644 --- a/config/xonsh/aliases.py +++ b/config/xonsh/aliases.py @@ -51,6 +51,10 @@ def _upd(args: list): path = Path("/etc/nixos") if path.exists(): c = colors.Colors + files_to_delete = { + "Visual Studio Code user settings": ".config/Code/User/settings.json.bak", + "fontconfig": ".config/fontconfig/conf.d/10-hm-fonts.conf.bak" + } print(f"{c.BLUE}Updating {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE}{c.END}") run(["sudo", "nixos-generate-config", "--dir", ".",], cwd=path / "hosts") print(f"{c.BLUE}Deleting redundant {c.YELLOW}NixOS{c.BLUE} configuration file{c.END}") @@ -59,8 +63,9 @@ def _upd(args: list): run(["sudo", "mv", "hardware-configuration.nix", "{hostname}.nix".format(hostname=gethostname())], cwd=path / "hosts") print(f"{c.BLUE}Adding {c.YELLOW}NixOS{c.BLUE} hardware configuration file for {c.YELLOW}{gethostname()}{c.BLUE} to git{c.END}") run(["git", "add", "hosts/{hostname}.nix".format(hostname=gethostname())], cwd=path) - print(f"{c.BLUE}Deleting {c.YELLOW}Visual Studio Code{c.BLUE} user settings backup file{c.END}") - run(["rm", ".config/Code/User/settings.json.bak"], exit_on_error=False, cwd="/home/cswimr") + for file_description, file_path in files_to_delete.items(): + print(f"{c.BLUE}Deleting {c.YELLOW}{file_description}{c.BLUE} backup file{c.END}") + run(["rm", file_path], exit_on_error=False, cwd="/home/cswimr") if "--purge-vscode-extensions" in args: args.remove("--purge-vscode-extensions") print(f"{c.BLUE}Killing {c.YELLOW}Visual Studio Code{c.BLUE} processes{c.END}")