Skip to content

Commit

Permalink
config: add screencopy:custom_picker_binary
Browse files Browse the repository at this point in the history
fixes #303
  • Loading branch information
vaxerski committed Dec 13, 2024
1 parent fd85ef3 commit 0c6861f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/PortalManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/shared/ScreencopyShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> 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");
Expand Down

0 comments on commit 0c6861f

Please sign in to comment.