Skip to content

core: use a screenshot for fade in/out#726

Merged
PointerDilemma merged 5 commits intohyprwm:mainfrom
PointerDilemma:screenshotfade
Jun 22, 2025
Merged

core: use a screenshot for fade in/out#726
PointerDilemma merged 5 commits intohyprwm:mainfrom
PointerDilemma:screenshotfade

Conversation

@PointerDilemma
Copy link
Collaborator

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.

@fxzzi
Copy link

fxzzi commented Apr 16, 2025

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!

@PointerDilemma PointerDilemma marked this pull request as ready for review June 13, 2025 11:01
@PointerDilemma PointerDilemma requested a review from vaxerski June 13, 2025 11:30
@PointerDilemma
Copy link
Collaborator Author

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.

Copy link

@b0ch3nski b0ch3nski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nitpicks

@PointerDilemma PointerDilemma requested a review from vaxerski June 19, 2025 13:54
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of changes for "using a screenshot" but alright, looks ok

@PointerDilemma
Copy link
Collaborator Author

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 🚆

@PointerDilemma PointerDilemma merged commit a963898 into hyprwm:main Jun 22, 2025
1 check passed
@PointerDilemma PointerDilemma deleted the screenshotfade branch June 22, 2025 07:34
@leon-erd
Copy link
Contributor

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
image
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 😅
The current behaviour causes my hyprlock to not display my lock screen wallpaper (before interacting with the popup) leaving everything on the screens visible.

@vaxerski
Copy link
Member

or just set the permission for hyprlock's binary only. rtfm: https://wiki.hypr.land/Configuring/Permissions/#notes

@leon-erd
Copy link
Contributor

@vaxerski huh wdym?
As stated above setting the following does nothing... 🤔
permission=/nix/store/aqr1ya8vy6zbx3slbx547hvldwdh2c70-hyprlock-0.8.2+date=2025-06-22_a963898/bin/hyprlock, screencopy, allow

@vaxerski
Copy link
Member

vaxerski commented Jun 26, 2025

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.

@leon-erd
Copy link
Contributor

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

@vaxerski
Copy link
Member

@fufexan that example is wrong, it will break if you have any funky regex characters in the path. Can you nuke it?

@leon-erd
Copy link
Contributor

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 😀
Nix has a function for this. I will submit a PR for the wiki making use of this :))

@fufexan
Copy link
Member

fufexan commented Jun 26, 2025

Damn, forgot we have + in some version strings.

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

Successfully merging this pull request may close these issues.

6 participants