Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grimblast throwing error only on keybind invocation #125

Open
rohrsben opened this issue Jan 12, 2025 · 6 comments
Open

Grimblast throwing error only on keybind invocation #125

rohrsben opened this issue Jan 12, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@rohrsben
Copy link

Program

Grimblast

Maintainers of the program

@fufexan, @Misterio77

Bug or Regression?

Bug

Description

I have print bound to an area selection:
bind = ,Print, exec, grimblast --notify save area $XDG_PICTURES_DIR/screenshots/$(date +'%b%d-%T.png')

When invoked by pressing print, I get a notification saying Error: Unable to invoke grim. When running the exact same command in the terminal, it works as expected. Additionally, grimblast check returns all OKs.

How to reproduce

  1. Set keybind as above
  2. Press key

...maybe? not sure if this will reproduce

Hyprland crash reports, program logs, images, videos

Nixos unstable, grimblast installed via flake

@rohrsben rohrsben added the bug Something isn't working label Jan 12, 2025
@fufexan
Copy link
Member

fufexan commented Jan 12, 2025

Doesn't happen on my end. How are you launching Hyprland?

@rohrsben
Copy link
Author

uwsm start default.

I forgot to mention that the keybind used to work, though I have no idea when it broke as I don't take many screenshots.

@fufexan
Copy link
Member

fufexan commented Jan 12, 2025

If you configure hyprland through HM, can you add this? (assuming it's not like this already)

bind = [
  # ...
  ", Print, exec, ${grimblast} --notify save area $XDG_PICTURES_DIR/screenshots/$(date +'%b%d-%T.png')"
];

If you don't configure with HM, then maybe try using the full path to grimblast.

@rohrsben
Copy link
Author

bind = ,Print, exec, /nix/store/jq18d66r9rv2wmd1h440nxx9n8sbkn8n-grimblast-0.1/bin/grimblast --notify save area $XDG_PICTURES_DIR/screenshots/$(date +'%b%d-%T.png')

No luck.

@rohrsben
Copy link
Author

In case some clarifying info helps, grimblast does launch. I can select an area/window just fine, its only when I release the mouse button to take the screenshot that it tells me the error.

@rohrsben
Copy link
Author

rohrsben commented Jan 13, 2025

Did a bit of troubleshooting: $FILE at line 171 in grimblast is set to /screenshots/<date>.png, not <xdgpics>/screenshots/<date>.png, causing grim to fail on no such file/dir. echo <xdgpics> in my term has correct output, and hardcoding the xdg pictures dir a la bind = ,Print, exec, <nixstore>grimblast --notify save area /home/error/xdg/pictures/screenshots/$(date +'%b%d-%T.png') makes the screenshot succeed.

I don't know anything about systemd or uwsm, but somehow XDG_PICTURES_DIR isn't propagating through.

Additional attempt: bind = ,Print, exec, notify-send "pics dir" "$XDG_PICTURES_DIR" sends an empty notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants