diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d60b42..4dfb8a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ else() message(STATUS "Configuring hypridle in Release with CMake") endif() +add_compile_definitions(HYPRIDLE_VERSION="${VERSION}") + include_directories(. "protocols/") include(GNUInstallDirs) diff --git a/src/main.cpp b/src/main.cpp index 71dbd1f..1a8d316 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,6 +15,11 @@ int main(int argc, char** argv, char** envp) { else if (arg == "--quiet" || arg == "-q") Debug::quiet = true; + else if (arg == "--version" || arg == "-V") { + Debug::log(NONE, "hypridle v{}", HYPRIDLE_VERSION); + return 0; + } + else if (arg == "--config" || arg == "-c") { if (i + 1 >= argc) { Debug::log(NONE, "After " + arg + " you should provide a path to a config file.");