From 0c6861f819f6d31f6195c9864709b2556f00b5cf Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 13 Dec 2024 21:11:19 +0000 Subject: [PATCH] config: add screencopy:custom_picker_binary fixes #303 --- src/core/PortalManager.cpp | 1 + src/shared/ScreencopyShared.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/PortalManager.cpp b/src/core/PortalManager.cpp index d091551..9111870 100644 --- a/src/core/PortalManager.cpp +++ b/src/core/PortalManager.cpp @@ -43,6 +43,7 @@ CPortalManager::CPortalManager() { m_sConfig.config->addConfigValue("general:toplevel_dynamic_bind", Hyprlang::INT{0L}); m_sConfig.config->addConfigValue("screencopy:max_fps", Hyprlang::INT{120L}); m_sConfig.config->addConfigValue("screencopy:allow_token_by_default", Hyprlang::INT{0L}); + m_sConfig.config->addConfigValue("screencopy:custom_picker_binary", Hyprlang::STRING{""}); m_sConfig.config->commence(); m_sConfig.config->parse(); diff --git a/src/shared/ScreencopyShared.cpp b/src/shared/ScreencopyShared.cpp index 22064a6..0db7b9c 100644 --- a/src/shared/ScreencopyShared.cpp +++ b/src/shared/ScreencopyShared.cpp @@ -47,12 +47,13 @@ SSelectionData promptForScreencopySelection() { static auto* const* PALLOWTOKENBYDEFAULT = (Hyprlang::INT* const*)g_pPortalManager->m_sConfig.config->getConfigValuePtr("screencopy:allow_token_by_default")->getDataStaticPtr(); + static auto* const* PCUSTOMPICKER = (Hyprlang::STRING* const)g_pPortalManager->m_sConfig.config->getConfigValuePtr("screencopy:custom_picker_binary")->getDataStaticPtr(); std::vector args; if (**PALLOWTOKENBYDEFAULT) args.emplace_back("--allow-token"); - CProcess proc("hyprland-share-picker", args); + CProcess proc(std::string{*PCUSTOMPICKER}.empty() ? "hyprland-share-picker" : *PCUSTOMPICKER, args); proc.addEnv("WAYLAND_DISPLAY", WAYLAND_DISPLAY ? WAYLAND_DISPLAY : ""); proc.addEnv("QT_QPA_PLATFORM", "wayland"); proc.addEnv("XCURSOR_SIZE", XCURSOR_SIZE ? XCURSOR_SIZE : "24");