From c10739e6e35c30ef5f273bfe5d219d361a31e226 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 10 Nov 2024 22:53:11 +0000 Subject: [PATCH] core: fixup execAndGet fixes #8410 --- hyprpm/src/core/PluginManager.cpp | 2 +- src/helpers/MiscFunctions.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hyprpm/src/core/PluginManager.cpp b/hyprpm/src/core/PluginManager.cpp index ef77f540..051ad500 100644 --- a/hyprpm/src/core/PluginManager.cpp +++ b/hyprpm/src/core/PluginManager.cpp @@ -30,7 +30,7 @@ using namespace Hyprutils::OS; static std::string execAndGet(std::string cmd) { cmd += " 2>&1"; - CProcess proc("/bin/sh", {cmd}); + CProcess proc("/bin/sh", {"-c", cmd}); if (!proc.runSync()) return "error"; diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 75154796..7b4d63a7 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -585,7 +585,7 @@ float vecToRectDistanceSquared(const Vector2D& vec, const Vector2D& p1, const Ve // Execute a shell command and get the output std::string execAndGet(const char* cmd) { - CProcess proc("/bin/sh", {cmd}); + CProcess proc("/bin/sh", {"-c", cmd}); if (!proc.runSync()) return "error";