Cannot execute grimblast via bind

Hyprland version
$ hyprctl version                                                                                                                                                                                                             21:24:13
Hyprland 0.50.1 built from branch  at commit 4e242d086e20b32951fdc0ebcbfb4d41b5be8dcc  ([gha] Nix: update inputs).
Date: Sat Jul 19 21:37:06 2025
Tag: v0.50.1, commits: 6291
built against:
 aquamarine 0.9.2
 hyprlang 0.6.3
 hyprutils 0.8.1
 hyprcursor 0.1.12
 hyprgraphics 0.1.5


no flags were set

Hi all, I have trouble executing a program via bind.

I’m trying to configure screenshot utility, previously I’ve used this bind and it worked:
bind = , Print, exec, grim -g “$(slurp -o -r -c ‘##ff0000ff’)” -t ppm - | satty --filename -
But I couldn’t freeze the screen when taking screenshot, so I wanted to try grimblast, here is the bind:
bind = , Print, exec, grimblast --freeze save output - | satty --filename -

The problem is the second bind does nothing at all (I’ve commented out the previous bind of course, so I have only one bind for Print). The command works as expected if invoked from the terminal. I’ve tried putting it in a script file and binding the script to Print, but again - nothing happens.

After fiddling a bit I’ve noticed that some programs can be executed via bind while others cannot, for example I can bind kitty to Print button and it will open up without issues, but if I bind VSCode (code command) it does nothing as well.

Question:
What could cause this?

Here is a piece of hyprland logs:
```
[LOG] Executing grimblast --freeze save output - | satty --filename -

[LOG] Process Created with pid 245468

[LOG] cursorImage request: shape 4 → pointer

[LOG] [AQ] drm: Cursor buffer imported into KMS with id 149

[LOG] cursorImage request: shape 1 → default

[LOG] [AQ] drm: Cursor buffer imported into KMS with id 144

[LOG] cursorImage request: shape 4 → pointer

```

A note: grimblast script is located in ~/.local/bin and this directory is in PATH, is it possible that hyprland still doesn’t see it somehow?

Is there a reason you are not using the hyprland/ecosystem?

hyprshot can be your friend and freeze option comes with < -z >

All options available with hyprshot - - help

From my experience it works as intended.

I wanted to use satty for quick edits and annotations of the screenshots, then just stumbled across grim and slurp combinations. I looked at the hyprshot as well, but thought that it is dead since the last update was over a year ago.

Nope, didn’t have it. But the issue was in my PATH variable, I will post a solution here.

On reddit a user suggested to check how $PATH looks like for hyprland (https://www.reddit.com/r/hyprland/comments/1muoe88/comment/n9lnrkh/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button):

hyprctl dispatch exec "which grimblast >~/out.log 2>&1"; cat out.log

The output:

which: no grimblast in (/home/username/Programs/Rust/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/mnt/wdblack/Projects/cppfront-0.8.1/build/:/home/username/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin)

I was adding the directories ~/.local/bin and the one containing code in .zshrc, I also run hyprland via uwsm, so I suppose it sees the earlier version of the PATH and doesn’t see further changes.

Solved it by moving necessary path changes into `$HOME/.zshenv`.

It’s worth noting Hyprland in most cases does not inherit bashrc / zshrc / whatever. It will only do so if launched from a tty, because you launch it from bash/zsh/etc.

So, if you add something to path in your rc, and use a login manager, Hyprland will not have that.

2 Likes

Interesting. Does it take in .profile like other desktops though?

I think the answer is no, and that sucks. Some things (for example, the Android SDK) use profile files (/etc/profile.d/,usually sourced by the main /etc/profile) to add their stuff to the path (and other env variables) and will crash otherwise. I don’t like the fact that I’m forced to source them manually in my shell, and it will be unusable if not opened via said shell.

I see. My Hyprland auto signs in via greetd and agreety from tty. So I’ve never run into this issue.

By the way, you can now do:

GRIMBLAST_EDITOR="satty --filename" grimblast --freeze edit output

Or if you want an area:

GRIMBLAST_EDITOR="satty --filename" grimblast --freeze edit area

and it’ll work :)