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

Screenshot ... *without shader* #22

Open
agentx3 opened this issue Jan 10, 2024 · 1 comment
Open

Screenshot ... *without shader* #22

agentx3 opened this issue Jan 10, 2024 · 1 comment

Comments

@agentx3
Copy link

agentx3 commented Jan 10, 2024

Hey, just a minor issue/request.

I would like to be able to take screenshots (currently using grim and slurp) in such a a way that the shader isn't present.

I saw that at one point this was behavior and it was "fixed" so I can understand if my request seems backwards. It would be nice because if you send the screenshot to someone that also has a filter on then they'll see the images as extra yellow due to the stacked filters. Overall keeping the filter applied on the screenshots is just a destructive operation and removes the true colors from the underlying image.

I do have a simple workaround so it's not thaat big of an issue, so it's just a nice-to-have:
hyprshade off && grim -g "$(slurp)" - | xsel -b && hyprshade on blue-light-filter.glsl

Thanks for making hyprshade.

@loqusion
Copy link
Owner

loqusion commented Jan 10, 2024

Yep this happens to me all the time.

I have a keybind in my Hyprland config that toggles the shader on/off with hyprshade toggle. Usually I'll take a screenshot, realize that I had the blue light filter on, and then redo it after toggling it off.

If you want it automated, you can probably do something like:

bind = ,Print, exec, shader=$(hyprshade current) && hyprshade off && $scripts/screenshot.sh output && hyprshade on "${shader}"

...or do something similar in a script.

Edit: here's something a bit more robust that I added to my screenshot script:

restore_shader() {
  if [ -n "$shader" ]; then
    hyprshade on "$shader"
  fi
}

save_shader() {
  shader=$(hyprshade current)
  hyprshade off
  trap restore_shader EXIT
}

save_shader
# ...rest of screenshot script...

@loqusion loqusion pinned this issue Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants