summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruint23 <72694427+uint23@users.noreply.github.com>2025-05-20 15:55:40 +0100
committerGitHub <noreply@github.com>2025-05-20 15:55:40 +0100
commit0f7dd226b703e783e837f2a7db59d1b1a255872a (patch)
treef109f41e6cdf992fa70c1428047a1f50708a1fe2
parent86a8bba41f1757c605badda8afdf4c1d759a0dd1 (diff)
parenta2a5460316e933fcc0c40e1362ed4a9c101d6e1c (diff)
Merge pull request #33 from werdl/makefile
Copy sxwmrc during installation
-rw-r--r--Makefile3
-rw-r--r--src/parser.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2721383..adeb0e3 100644
--- a/Makefile
+++ b/Makefile
@@ -42,6 +42,9 @@ install: all
@echo "Installing man page to $(DESTDIR)$(MAN_DIR)..."
@mkdir -p $(DESTDIR)$(MAN_DIR)
@install -m 644 $(MAN) $(DESTDIR)$(MAN_DIR)/
+ @echo "Copying default configuration to $(DESTDIR)$(PREFIX)/share/sxwmrc..."
+ @mkdir -p "$(DESTDIR)$(PREFIX)/share"
+ @install -m 644 default_sxrc "$(DESTDIR)$(PREFIX)/share/sxwmrc"
@echo "Installation complete."
uninstall:
diff --git a/src/parser.c b/src/parser.c
index 1ceb7e0..a2de128 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -160,6 +160,11 @@ int parser(Config *cfg)
goto found;
}
+ snprintf(path, sizeof path, "/usr/local/share/sxwmrc");
+ if (access(path, R_OK) == 0) {
+ goto found;
+ }
+
found:
FILE *f = fopen(path, "r");
if (!f) {