2022-07-01 23:05:58 +02:00
|
|
|
#include <iostream>
|
|
|
|
#include "defines.hpp"
|
|
|
|
#include "Hyprpaper.hpp"
|
|
|
|
|
|
|
|
int main(int argc, char** argv, char** envp) {
|
2024-12-14 16:09:40 +01:00
|
|
|
Debug::log(LOG, "Welcome to hyprpaper!\nbuilt from commit {} ({})", GIT_COMMIT_HASH, GIT_COMMIT_MESSAGE);
|
2022-07-01 23:05:58 +02:00
|
|
|
|
2022-09-27 02:31:25 +02:00
|
|
|
// parse some args
|
|
|
|
std::string configPath;
|
2024-07-17 16:25:07 +02:00
|
|
|
bool noFractional = false;
|
2022-09-27 02:31:25 +02:00
|
|
|
for (int i = 1; i < argc; ++i) {
|
|
|
|
if ((!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config")) && argc >= i + 2) {
|
|
|
|
configPath = std::string(argv[++i]);
|
2024-12-14 16:09:40 +01:00
|
|
|
Debug::log(LOG, "Using config location {}.", configPath);
|
2023-01-29 17:38:48 +01:00
|
|
|
} else if (!strcmp(argv[i], "--no-fractional") || !strcmp(argv[i], "-n")) {
|
|
|
|
noFractional = true;
|
|
|
|
Debug::log(LOG, "Disabling fractional scaling support!");
|
2022-09-27 02:31:25 +02:00
|
|
|
} else {
|
2024-07-17 16:25:07 +02:00
|
|
|
std::cout << "Hyprpaper usage: hyprpaper [arg [...]].\n\nArguments:\n"
|
|
|
|
<< "--help -h | Show this help message\n"
|
|
|
|
<< "--config -c | Specify config file to use\n"
|
|
|
|
<< "--no-fractional -n | Disable fractional scaling support\n";
|
2022-09-27 02:31:25 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-01 23:05:58 +02:00
|
|
|
// starts
|
2024-07-17 16:25:07 +02:00
|
|
|
g_pHyprpaper = std::make_unique<CHyprpaper>();
|
2022-09-28 05:29:33 +02:00
|
|
|
g_pHyprpaper->m_szExplicitConfigPath = configPath;
|
2024-07-17 16:25:07 +02:00
|
|
|
g_pHyprpaper->m_bNoFractionalScale = noFractional;
|
2022-07-01 23:05:58 +02:00
|
|
|
g_pHyprpaper->init();
|
|
|
|
|
|
|
|
return 0;
|
2024-10-25 13:29:16 +02:00
|
|
|
}
|