contrib icon indicating copy to clipboard operation
contrib copied to clipboard

`SLURP_ARGS` doesn't function when more than one argument is specified

Open mirrorcult opened this issue 1 year ago • 1 comments

Program

grimblast

Maintainers of the program

@fufexan

Bug or Regression?

Bug

Description

simply put, the code for passing custom cli args to slurp does not work: https://github.com/hyprwm/contrib/blob/1e531dc49ad36c88b45bf836081a7a2c8927e072/grimblast/grimblast#L238

fairly confident this never worked as bash just doesn't let you do this -- any argument after the first gets dropped when you try to pass it like this

image

as you can see here, only the first argument -d (show dimensions) is working, all of the others are nonfunctional.

How to reproduce

  1. set SLURP_ARGS with more than one argument separated by spaces
  2. see that any arguments after the first do not apply

Hyprland crash reports, program logs, images, videos

No response

mirrorcult avatar Oct 02 '24 17:10 mirrorcult

Can you check whether quoting the variable makes it work?

fufexan avatar Oct 02 '24 17:10 fufexan

Not working for me either, when I set $SLURP_ARGS to -b "#00000000" -c "#80808080" -w 2 (adding 's between that whole thing makes slurp $SLURP_ARGS not work).

MoltenMonster avatar Jun 13 '25 00:06 MoltenMonster

Can you try https://github.com/hyprwm/contrib/tree/slurp_args?

fufexan avatar Jun 13 '25 07:06 fufexan

I setup the nix flake with the following

    hyprland-contrib = {
      url = "github:hyprwm/contrib/?ref=slurp_args";
      inputs.nixpkgs.follows = "nixpkgs";
    };

And set SLURP_ARGS to -b "#00000000" -c "#80808080" -w 2 then did grimblast save area and it doesn't seem to work?

MoltenMonster avatar Jun 13 '25 17:06 MoltenMonster

How did you set it? Seems to work for me with export SLURP_ARGS="-b "#00000000" -c "#80808080" -w 2"

fufexan avatar Jun 13 '25 20:06 fufexan

Oh I set it locally with set in fish. Export works for me, thanks.

MoltenMonster avatar Jun 13 '25 21:06 MoltenMonster

Great. I'll rebase that on main then.

fufexan avatar Jun 13 '25 21:06 fufexan

https://github.com/hyprwm/contrib/commit/26c72abe70bf149684dee838618dbb388f54d27d

fufexan avatar Jun 13 '25 21:06 fufexan

@fufexan Actually I have a question: how can I make it not add a white overlay?

MoltenMonster avatar Jun 13 '25 21:06 MoltenMonster

-b #00000000

fufexan avatar Jun 13 '25 21:06 fufexan

even with the SLURP_ARGS exported I still see a white overlay on the current app when I do grimblast save area.

MoltenMonster avatar Jun 13 '25 21:06 MoltenMonster

Oh, that would be -B, according to man slurp.

fufexan avatar Jun 13 '25 21:06 fufexan

Oh, thanks.

MoltenMonster avatar Jun 14 '25 05:06 MoltenMonster