diff options
author | Vaxry <[email protected]> | 2024-06-11 17:17:45 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-11 17:17:45 +0200 |
commit | 8c64a4bad710fb18e9b84812bd680a89d1e93661 (patch) | |
tree | 2439b8408abd8e14f6af35ef9cfbeb7c51429f99 /hyprctl | |
parent | 1f46296ea05f9a8e6020ab694b531c91a1abdfa6 (diff) | |
download | Hyprland-8c64a4bad710fb18e9b84812bd680a89d1e93661.tar.gz Hyprland-8c64a4bad710fb18e9b84812bd680a89d1e93661.zip |
core: move to hyprutils for utils (#6385)
* core: move to hyprutils for utils
Nix: add hyprutils dep
* Meson: add hyprutils dep
* flake.lock: update
---------
Co-authored-by: Mihai Fufezan <[email protected]>
Diffstat (limited to 'hyprctl')
-rw-r--r-- | hyprctl/CMakeLists.txt | 4 | ||||
-rw-r--r-- | hyprctl/main.cpp | 8 | ||||
-rw-r--r-- | hyprctl/meson.build | 3 |
3 files changed, 9 insertions, 6 deletions
diff --git a/hyprctl/CMakeLists.txt b/hyprctl/CMakeLists.txt index 6f70ace8..64b983e6 100644 --- a/hyprctl/CMakeLists.txt +++ b/hyprctl/CMakeLists.txt @@ -5,8 +5,12 @@ project( DESCRIPTION "Control utility for Hyprland" ) +pkg_check_modules(deps REQUIRED IMPORTED_TARGET hyprutils>=0.1.1) + add_executable(hyprctl "main.cpp") +target_link_libraries(hyprctl PUBLIC PkgConfig::deps) + # binary install(TARGETS hyprctl) diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 34abe46f..8fb9194c 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -24,6 +24,8 @@ #include <filesystem> #include <stdarg.h> #include <regex> +#include <hyprutils/string/String.hpp> +using namespace Hyprutils::String; #include "Strings.hpp" @@ -270,12 +272,6 @@ std::deque<std::string> splitArgs(int argc, char** argv) { return result; } -bool isNumber(const std::string& str, bool allowfloat) { - if (str.empty()) - return false; - return std::ranges::all_of(str.begin(), str.end(), [&](char c) { return isdigit(c) != 0 || c == '-' || (allowfloat && c == '.'); }); -} - int main(int argc, char** argv) { bool parseArgs = true; diff --git a/hyprctl/meson.build b/hyprctl/meson.build index 94e98b4b..5488845f 100644 --- a/hyprctl/meson.build +++ b/hyprctl/meson.build @@ -1,4 +1,7 @@ executable('hyprctl', 'main.cpp', + dependencies: [ + dependency('hyprutils', version: '>= 0.1.1'), + ], install: true ) |