|
| 1 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 2 | +index d1cec67..cdf8e50 100644 |
| 3 | +--- a/CMakeLists.txt |
| 4 | ++++ b/CMakeLists.txt |
| 5 | +@@ -70,6 +70,7 @@ message(STATUS "Checking deps...") |
| 6 | + |
| 7 | + find_package(Threads REQUIRED) |
| 8 | + find_package(PkgConfig REQUIRED) |
| 9 | ++find_package(fmt REQUIRED) |
| 10 | + find_package(OpenGL REQUIRED COMPONENTS EGL GLES3) |
| 11 | + find_package(hyprwayland-scanner 0.4.4 REQUIRED) |
| 12 | + pkg_check_modules( |
| 13 | +@@ -96,7 +97,7 @@ pkg_check_modules( |
| 14 | + file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp") |
| 15 | + add_executable(hyprlock ${SRCFILES}) |
| 16 | + target_link_libraries(hyprlock PRIVATE pam rt Threads::Threads PkgConfig::deps |
| 17 | +- OpenGL::EGL OpenGL::GLES3) |
| 18 | ++ OpenGL::EGL OpenGL::GLES3 fmt::fmt) |
| 19 | + |
| 20 | + # protocols |
| 21 | + pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) |
| 22 | +diff --git a/src/helpers/Log.hpp b/src/helpers/Log.hpp |
| 23 | +index 00770da..ec6e68d 100644 |
| 24 | +--- a/src/helpers/Log.hpp |
| 25 | ++++ b/src/helpers/Log.hpp |
| 26 | +@@ -1,7 +1,7 @@ |
| 27 | + #pragma once |
| 28 | + #include <format> |
| 29 | + #include <string> |
| 30 | +-#include <print> |
| 31 | ++#include <fmt/core.h> |
| 32 | + |
| 33 | + enum eLogLevel { |
| 34 | + TRACE = 0, |
| 35 | +@@ -48,7 +48,7 @@ namespace Debug { |
| 36 | + return; |
| 37 | + |
| 38 | + if (level != NONE) { |
| 39 | +- std::println("[{}] {}", logLevelString(level), std::vformat(fmt, std::make_format_args(args...))); |
| 40 | ++ fmt::print("[{}] {}", logLevelString(level), std::vformat(fmt, std::make_format_args(args...))); |
| 41 | + } |
| 42 | + } |
| 43 | + }; |
| 44 | +\ No newline at end of file |
| 45 | +diff --git a/src/main.cpp b/src/main.cpp |
| 46 | +index ff2bcbc..da5436c 100644 |
| 47 | +--- a/src/main.cpp |
| 48 | ++++ b/src/main.cpp |
| 49 | +@@ -5,9 +5,10 @@ |
| 50 | + #include "core/AnimationManager.hpp" |
| 51 | + #include <cstddef> |
| 52 | + #include <string_view> |
| 53 | ++#include <fmt/core.h> |
| 54 | + |
| 55 | + void help() { |
| 56 | +- std::println("Usage: hyprlock [options]\n\n" |
| 57 | ++ fmt::print("Usage: hyprlock [options]\n\n" |
| 58 | + "Options:\n" |
| 59 | + " -v, --verbose - Enable verbose logging\n" |
| 60 | + " -q, --quiet - Disable logging\n" |
| 61 | +@@ -24,7 +25,7 @@ std::optional<std::string> parseArg(const std::vector<std::string>& args, const |
| 62 | + if (i + 1 < args.size()) { |
| 63 | + return args[++i]; |
| 64 | + } else { |
| 65 | +- std::println(stderr, "Error: Missing value for {} option.", flag); |
| 66 | ++ fmt::print(stderr, "Error: Missing value for {} option.", flag); |
| 67 | + return std::nullopt; |
| 68 | + } |
| 69 | + } |
| 70 | +@@ -49,9 +50,9 @@ int main(int argc, char** argv, char** envp) { |
| 71 | + if (arg == "--version" || arg == "-V") { |
| 72 | + constexpr bool ISTAGGEDRELEASE = std::string_view(HYPRLOCK_COMMIT) == HYPRLOCK_VERSION_COMMIT; |
| 73 | + if (ISTAGGEDRELEASE) |
| 74 | +- std::println("Hyprlock version v{}", HYPRLOCK_VERSION); |
| 75 | ++ fmt::print("Hyprlock version v{}", HYPRLOCK_VERSION); |
| 76 | + else |
| 77 | +- std::println("Hyprlock version v{} (commit {})", HYPRLOCK_VERSION, HYPRLOCK_COMMIT); |
| 78 | ++ fmt::print("Hyprlock version v{} (commit {})", HYPRLOCK_VERSION, HYPRLOCK_COMMIT); |
| 79 | + |
| 80 | + return 0; |
| 81 | + } |
| 82 | +@@ -84,7 +85,7 @@ int main(int argc, char** argv, char** envp) { |
| 83 | + noFadeIn = true; |
| 84 | + |
| 85 | + else { |
| 86 | +- std::println(stderr, "Unknown option: {}", arg); |
| 87 | ++ fmt::print(stderr, "Unknown option: {}", arg); |
| 88 | + help(); |
| 89 | + return 1; |
| 90 | + } |
0 commit comments