Grimblast throwing error only on keybind invocation
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
- Set keybind as above
- Press key
...maybe? not sure if this will reproduce
Hyprland crash reports, program logs, images, videos
Nixos unstable, grimblast installed via flake
Doesn't happen on my end. How are you launching Hyprland?
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.
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.
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.
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.
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.
Forgot to mark this as solved:
If anyone reading sets custom xdg dirs like I do, you can just directly interpolate them in scripts a la ${config.xdg.userDirs.pictures}. Probably a healthier way to do it anyways