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

Add our wayland compatible screenlocker #636

Merged
merged 8 commits into from
Jan 12, 2025
Merged

Add our wayland compatible screenlocker #636

merged 8 commits into from
Jan 12, 2025

Conversation

fossfreedom
Copy link
Contributor

@fossfreedom fossfreedom commented Nov 13, 2024

Description

This PR is another "low hanging fruit" - this replaces budgie-screensaver / gnome-screensaver with a wayland compatible screenlocker.

It wires up the various screenlock settings in BCC.

At the same time it wires up the power control settings in BCC to suspend on battery / ac if idle

The how;

it uses swayidle as our idle controller
it uses either gtklock or swaylock for the lockscreen
it uses wlopm to control screen blanking
it uses systemctl to suspend
it uses upower GLIB library to determine battery/ac states.

The power dialog lock button previously was linked to the screensaver lock function - this now has been reorientated to a new dbus entry to perform the same function.

Most definitely this really needs a good testing effort since there are lots of combinations that can be achieved.

gtklock is basically vanilla, but we support distros to either style (gtklock.css) and/or add a config (gtklock.ini) in the DATA for CONFIG budgie-desktop folder (/usr/share/budgie-desktop/ or /etc/budgie-desktop/)

I haven't wired up the BCC "dim" control - this should perhaps be part of Josh's v2 daemon since it needs calling via a wayland client to control the screen brightness.

Submitter Checklist

  • Squashed commits with git rebase -i (if needed)
  • Built budgie-desktop and verified that the patch worked (if needed)

@JoshStrobl JoshStrobl self-requested a review November 21, 2024 18:14
src/daemon/screenlock.vala Outdated Show resolved Hide resolved
src/daemon/screenlock.vala Outdated Show resolved Hide resolved
src/daemon/meson.build Outdated Show resolved Hide resolved
Copy link
Member

@JoshStrobl JoshStrobl left a comment

Choose a reason for hiding this comment

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

My only bit of feedback would be to make sure we add swayidle and wlopm as dependencies in our meson.build. While technically they are runtime dependencies, it is still a good way to make sure the packager has acknowledged that they are required.

I have cloned, built gtk-session-lock + gtklock, installed wlopm and swayidle, and updated my power / idle settings to lock on screen blanking. Set it to 1 minute for testing and it worked, then changed it to 3 minutes and it correctly updated to the new value.

Upon blanking, gtklock fired up as one would hope, showing a block on my "second" monitor with a prompt on my first. Likely it was the inverse but regardless, no funny business with locking anymore which is absolutely freaking fantastic.

Logged in and while clearly there is some work I need to do on the daemon side to re-force displays to be positioned when they pop back up, your implementation worked perfectly!

@fossfreedom
Copy link
Contributor Author

My only bit of feedback would be to make sure we add swayidle and wlopm as dependencies in our meson.build. While technically they are runtime dependencies, it is still a good way to make sure the packager has acknowledged that they are required.

as discussed - new build option to check for runtime dependencies

@JoshStrobl JoshStrobl self-requested a review January 11, 2025 10:43
Copy link
Member

@JoshStrobl JoshStrobl left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Been testing it for a while now and it's been reliable.

This is to aid packagers/developers where there are apps
that are needed to successfully run budgie-desktop.
For the final packaging, distros can switch off this check
to speed up build-time i.e. limit the number of additional
dependencies these packages would bring in.
src/daemon/screenlock.vala Outdated Show resolved Hide resolved
Copy link
Member

@serebit serebit left a comment

Choose a reason for hiding this comment

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

Got some suggestions.

src/daemon/screenlock.vala Outdated Show resolved Hide resolved
src/daemon/screenlock.vala Outdated Show resolved Hide resolved
src/daemon/screenlock.vala Outdated Show resolved Hide resolved
src/daemon/screenlock.vala Outdated Show resolved Hide resolved
src/daemon/screenlock.vala Outdated Show resolved Hide resolved
…and switch to using dbus rather than systemctl for suspend
@fossfreedom fossfreedom requested a review from serebit January 11, 2025 20:02
Copy link
Member

@serebit serebit left a comment

Choose a reason for hiding this comment

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

LGTM.

@JoshStrobl JoshStrobl merged commit 1ca6fcf into main Jan 12, 2025
1 check passed
@JoshStrobl JoshStrobl deleted the screenlock branch January 12, 2025 09:39
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.

3 participants