mirror of
https://github.com/hyprwm/hyprsunset.git
synced 2025-05-12 21:30:41 +01:00
fixes #28
This commit is contained in:
parent
7b7339f0de
commit
fdcc9a1e17
3 changed files with 15 additions and 3 deletions
|
@ -87,7 +87,7 @@ int CHyprsunset::init() {
|
|||
const std::string IFACE = interface;
|
||||
|
||||
if (IFACE == hyprland_ctm_control_manager_v1_interface.name) {
|
||||
auto targetVersion = std::min(version, 2u);
|
||||
auto targetVersion = std::min(version, 2u);
|
||||
|
||||
Debug::log(NONE, "┣ Found hyprland-ctm-control-v1 supported with version {}, binding to v{}", version, targetVersion);
|
||||
state.pCTMMgr = makeShared<CCHyprlandCtmControlManagerV1>(
|
||||
|
|
|
@ -16,8 +16,13 @@ enum LogLevel {
|
|||
};
|
||||
|
||||
namespace Debug {
|
||||
inline bool trace = false;
|
||||
|
||||
template <typename... Args>
|
||||
void log(LogLevel level, std::format_string<Args...> fmt, Args&&... args) {
|
||||
if (!trace && (level == LOG || level == INFO))
|
||||
return;
|
||||
|
||||
switch (level) {
|
||||
case NONE: break;
|
||||
case LOG: std::cout << "[LOG] "; break;
|
||||
|
|
11
src/main.cpp
11
src/main.cpp
|
@ -6,13 +6,13 @@ static void printHelp() {
|
|||
Debug::log(NONE, "┣ --gamma_max → Set the maximum display gamma (default 100%, maximum 200%)");
|
||||
Debug::log(NONE, "┣ --temperature -t → Set the temperature in K (default 6000)");
|
||||
Debug::log(NONE, "┣ --identity -i → Use the identity matrix (no color change)");
|
||||
Debug::log(NONE, "┣ --verbose → Print more logging");
|
||||
Debug::log(NONE, "┣ --version -v → Print the version");
|
||||
Debug::log(NONE, "┣ --help -h → Print this info");
|
||||
Debug::log(NONE, "╹");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv, char** envp) {
|
||||
Debug::log(NONE, "┏ hyprsunset v{} ━━╸\n┃", HYPRSUNSET_VERSION);
|
||||
|
||||
g_pHyprsunset = std::make_unique<CHyprsunset>();
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
|
@ -64,6 +64,11 @@ int main(int argc, char** argv, char** envp) {
|
|||
} else if (argv[i] == std::string{"-h"} || argv[i] == std::string{"--help"}) {
|
||||
printHelp();
|
||||
return 0;
|
||||
} else if (argv[i] == std::string{"-v"} || argv[i] == std::string{"--version"}) {
|
||||
Debug::log(NONE, "hyprsunset v{}", HYPRSUNSET_VERSION);
|
||||
return 0;
|
||||
} else if (argv[i] == std::string{"--verbose"}) {
|
||||
Debug::trace = true;
|
||||
} else {
|
||||
Debug::log(NONE, "✖ Argument not recognized: {}", argv[i]);
|
||||
printHelp();
|
||||
|
@ -71,6 +76,8 @@ int main(int argc, char** argv, char** envp) {
|
|||
}
|
||||
}
|
||||
|
||||
Debug::log(NONE, "┏ hyprsunset v{} ━━╸\n┃", HYPRSUNSET_VERSION);
|
||||
|
||||
if (!g_pHyprsunset->calculateMatrix())
|
||||
return 1;
|
||||
if (!g_pHyprsunset->init())
|
||||
|
|
Loading…
Reference in a new issue