From 0d7a8cca790e8fa71a83e4dce09fbe5a0af38cbc Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 6 Jul 2022 16:17:58 +0200 Subject: use C++ throw methods instead of printf and exit --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index a437430f..0947f375 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,7 +12,7 @@ bool ignoreSudo = false; int main(int argc, char** argv) { if (!getenv("XDG_RUNTIME_DIR")) - RIP("XDG_RUNTIME_DIR not set!"); + throw std::runtime_error("XDG_RUNTIME_DIR is not set!"); // parse some args for (int i = 1; i < argc; ++i) { -- cgit v1.2.3 From 6708f3b1334e8b6a966f424fe04713a4e74d5fdb Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Wed, 13 Jul 2022 18:18:23 +0200 Subject: Fixed TTY switching (#364) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 0947f375..3f68fa8f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,7 +46,7 @@ int main(int argc, char** argv) { // If we are here it means we got yote. Debug::log(LOG, "Hyprland reached the end."); - g_pCompositor->cleanupExit(); + g_pCompositor->cleanup(); return EXIT_SUCCESS; } -- cgit v1.2.3 From 01fc3d6068f80c60e4113f14e375070e38329641 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 14 Jul 2022 23:55:24 +0300 Subject: add config flag you can now specify a config with -c --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main.cpp') 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(); + g_pCompositor->explicitConfigPath = configPath; Debug::log(LOG, "Hyprland init finished."); -- cgit v1.2.3 From d8fee02063343ecabe4853cb9738e1bd7ccb2a11 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 15 Jul 2022 00:09:31 +0300 Subject: add simple help message --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 753d406d..9367d870 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,9 +19,14 @@ int main(int argc, char** argv) { 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) { + else 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()); + } else { + std::cout << "Hyprland usage: Hyprland [arg [...]].\n\nArguments:\n" << + "--help -h | Show this help message\n" << + "--config -c | Specify config file to use\n"; + return 1; } } -- cgit v1.2.3