From 9b503ebd0eb063497d2919cf7fcf2d71430c28a8 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Mon, 12 Aug 2024 19:31:53 -0400 Subject: [PATCH] feature: if the configuration doesn't exist, we try to copy it from /usr/share/miracle-wm/config/default.yaml or we write it blank (#205) --- src/miracle_config.cpp | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/miracle_config.cpp b/src/miracle_config.cpp index 0f12929..04e9d0c 100644 --- a/src/miracle_config.cpp +++ b/src/miracle_config.cpp @@ -29,11 +29,14 @@ along with this program. If not, see . #include #include #include +#include using namespace miracle; namespace { +const char* MIRACLE_USR_SHARE_DIR = "/usr/share/miracle-wm/config/default.yaml"; + int program_exists(std::string const& name) { std::stringstream out; @@ -131,32 +134,41 @@ T try_parse_enum(YAML::Node const& root, const char* key, std::function