core: use a screenshot for fade in/out
Instead of relying on Hyprland drawing it's workspaces when locked, use a screenshot to fade in and out.
Basically had to rewrite the background widget. No merging yet. I might revision the background widget.
Needs testing.
Note:
This is supposed to go together with a MR that makes it so Hyprland does not draw workspaces when locked per default. But I have a misc:allow_session_lock_xray setting planed to keep it possible to use shape:xray or implement dynamic blur.
just tested for ya.
This helps a lot with the fade in animation. Previously it wouldn't work on my main monitor (maybe it did, but the fade looked like it was instant)
with this change the transition is a lot smoother. Thanks!
I also tested the reload_cmd and such. I think this is ready.
One thing I didn't mention yet: With this, the crossfade of the background can be configured with the fadeIn animation config, because it uses the same code as the fade in from screenshot the the inital background.
Should probably be it's own animation config in the future.
Most of it comes from the Background widget. It didn't make any sense to me to jank this feature on top of the existing background cross fade and reload code.
Thanks for reviewing and testing though. Merging :train2:
Hey @PaideiaDilemma :)
This commit has introduced a problem with hyprlands permission system for me.
Every time I launch hyprlock now this permission dialog pops up
This also happens after explicitly allowing the screencopy for hyprlock in my hyprland.conf
permission=/nix/store/aqr1ya8vy6zbx3slbx547hvldwdh2c70-hyprlock-0.8.2+date=2025-06-22_a963898/bin/hyprlock, screencopy, allow
Setting permission=.*, screencopy, allow does fix the issue but it is something that I would rather avoid :sweat_smile:
The current behaviour causes my hyprlock to not display my lock screen wallpaper (before interacting with the popup) leaving everything on the screens visible.
or just set the permission for hyprlock's binary only. rtfm: https://wiki.hypr.land/Configuring/Permissions/#notes
@vaxerski huh wdym?
As stated above setting the following does nothing... :thinking:
permission=/nix/store/aqr1ya8vy6zbx3slbx547hvldwdh2c70-hyprlock-0.8.2+date=2025-06-22_a963898/bin/hyprlock, screencopy, allow
because it's not valid regex probably. The first parameter is a regex, not a path. The link I sent outlines a regex for nix.
I have set this in nix as per the wiki
permission = [
"${lib.getExe config.programs.hyprlock.package}, screencopy, allow"
];
This just expands to the line I posted. Doing the same for grim etc works no problem. Could it be that internally hyprlock is spawning a different process to capture the screen which is not allowed by the rule?
Anyways I will try the regex from the wiki just to be sure
@fufexan that example is wrong, it will break if you have any funky regex characters in the path. Can you nuke it?
Ahhh I see what the problem is!! Characters with special meaning for regex (e.g. +) are not escaped and therefore the regex doesn't match the string. Makes total sense now :grinning:
Nix has a function for this. I will submit a PR for the wiki making use of this :))
Damn, forgot we have + in some version strings.