config: add screencopy:custom_picker_binary

fixes #303
This commit is contained in:
Vaxry 2024-12-13 21:11:19 +00:00
parent fd85ef3936
commit 0c6861f819
2 changed files with 3 additions and 1 deletions

View file

@ -43,6 +43,7 @@ CPortalManager::CPortalManager() {
m_sConfig.config->addConfigValue("general:toplevel_dynamic_bind", Hyprlang::INT{0L}); 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:max_fps", Hyprlang::INT{120L});
m_sConfig.config->addConfigValue("screencopy:allow_token_by_default", Hyprlang::INT{0L}); 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->commence();
m_sConfig.config->parse(); m_sConfig.config->parse();

View file

@ -47,12 +47,13 @@ SSelectionData promptForScreencopySelection() {
static auto* const* PALLOWTOKENBYDEFAULT = static auto* const* PALLOWTOKENBYDEFAULT =
(Hyprlang::INT* const*)g_pPortalManager->m_sConfig.config->getConfigValuePtr("screencopy:allow_token_by_default")->getDataStaticPtr(); (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<std::string> args; std::vector<std::string> args;
if (**PALLOWTOKENBYDEFAULT) if (**PALLOWTOKENBYDEFAULT)
args.emplace_back("--allow-token"); 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("WAYLAND_DISPLAY", WAYLAND_DISPLAY ? WAYLAND_DISPLAY : "");
proc.addEnv("QT_QPA_PLATFORM", "wayland"); proc.addEnv("QT_QPA_PLATFORM", "wayland");
proc.addEnv("XCURSOR_SIZE", XCURSOR_SIZE ? XCURSOR_SIZE : "24"); proc.addEnv("XCURSOR_SIZE", XCURSOR_SIZE ? XCURSOR_SIZE : "24");