aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMihai Fufezan <[email protected]>2022-07-14 23:55:24 +0300
committerMihai Fufezan <[email protected]>2022-07-14 23:55:24 +0300
commit01fc3d6068f80c60e4113f14e375070e38329641 (patch)
treee75d82cddbaa6608ffa6dad8cb0ed937b30096ee /src/main.cpp
parent316589406f948c3e4d8a32083600d0b32582a460 (diff)
downloadHyprland-01fc3d6068f80c60e4113f14e375070e38329641.tar.gz
Hyprland-01fc3d6068f80c60e4113f14e375070e38329641.zip
add config flag
you can now specify a config with -c <path>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3f68fa8f..753d406d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -15,9 +15,14 @@ int main(int argc, char** argv) {
throw std::runtime_error("XDG_RUNTIME_DIR is not set!");
// parse some args
+ std::string configPath;
for (int i = 1; i < argc; ++i) {
if (!strcmp(argv[i], "--i-am-really-stupid"))
ignoreSudo = true;
+ if ((!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) && argc >= i + 2) {
+ configPath = std::string(argv[++i]);
+ Debug::log(LOG, "Using config location %s.", configPath.c_str());
+ }
}
system("mkdir -p /tmp/hypr");
@@ -37,6 +42,7 @@ int main(int argc, char** argv) {
// let's init the compositor.
// it initializes basic Wayland stuff in the constructor.
g_pCompositor = std::make_unique<CCompositor>();
+ g_pCompositor->explicitConfigPath = configPath;
Debug::log(LOG, "Hyprland init finished.");