hyprpaper/src/main.cpp

28 lines
965 B
C++
Raw Normal View History

2022-07-01 23:05:58 +02:00
#include <iostream>
#include "defines.hpp"
#include "Hyprpaper.hpp"
int main(int argc, char** argv, char** envp) {
Debug::log(LOG, "Welcome to hyprpaper!\nbuilt from commit %s (%s)", GIT_COMMIT_HASH, GIT_COMMIT_MESSAGE);
2022-09-27 02:31:25 +02:00
// parse some args
std::string configPath;
for (int i = 1; i < argc; ++i) {
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 << "Hyprpaper usage: hyprpaper [arg [...]].\n\nArguments:\n" <<
"--help -h | Show this help message\n" <<
"--config -c | Specify config file to use\n";
return 1;
}
}
2022-07-01 23:05:58 +02:00
// starts
g_pHyprpaper = std::make_unique<CHyprpaper>();
2022-09-27 02:31:25 +02:00
g_pHyprpaper->explicitConfigPath = configPath;
2022-07-01 23:05:58 +02:00
g_pHyprpaper->init();
return 0;
}