Commit graph

263 commits

Author SHA1 Message Date
Maximilian Seidler
ae3bb0fd43
input-field: fix invert_numlock regression (#530) 2024-10-25 22:04:56 +01:00
Maximilian Seidler
f13d97e6d6
config: make the default widget position be 0,0 (#529) 2024-10-25 22:02:47 +01:00
a093a9eefd version: bump to 0.5.0 2024-10-22 01:09:26 +01:00
moggiesir
f48540fcd4
auth: Support parallel fingerprint auth (#514)
* auth: Support parallel fingerprint auth

I chose to use Fprint's dbus interface directly rather than going through pam (which uses Fprint's dbus interface) due to poor handling of system sleep somewhere between fprintd and pam. When preparing for sleep, fprintd puts the device to sleep, which causes VerifyStatus to emit with verify-unknown-error, which normally should be responded to by calling both Device.StopVerify and Device.Release (and this is what pam does). Unfortunately, if you try to release the device when the system is preparing for sleep, you'll get an error that the device is busy and then you can't can't claim or release the device for 30 seconds.

pam also has a max timeout for pam_fprintd.so of 99 seconds, and so if we used pam, we'd have to deal with the timeouts and keep restarting the auth conversation.

gdm/gnome-session lock seems to get around these issues by having a shutter on top of the lock screen that you have to interact with first that gives gnome-session a trigger to start fingerprint auth.

* nix/overlays: add sdbus overlay

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2024-10-22 01:08:24 +01:00
André Silva
b808086286
renderer: log framebuffer creation as trace (#518) 2024-10-17 15:23:58 +01:00
Vaxry
11694528b4
README: update deps 2024-10-13 13:05:11 +01:00
Maximilian Seidler
5065788a47
misc: use Vector2D, Box and Mat3x3 from hyprutils (#515)
* misc: use Vector2D, Box and Mat3x3 from hyprutils

* nix: flake update

Fix CI fails. We need hyprutils>=0.2.3

* misc: use a function to convert Hyprlang::VEC2 to Vector2D

* misc: fixup some includes
2024-10-13 13:04:32 +01:00
Maximilian Seidler
71021cc3de
input-field: add dots_text_format to support setting arbitrary chars as the input indicator (#510)
* input-field: make dots support arbitrary chars

* input-field: add font_familiy for placeholder and text dots

* input-field: allow dots_spacing from -1.0 to 1.0

Useful when using emojis in  dots_text_format
2024-10-13 00:16:31 +01:00
Maximilian Seidler
7362ce3435
misc: use hyprutils for string replaceAll (#512) 2024-10-11 16:44:47 +01:00
The-Emperor10
264fb8b70f
config: add input-field dots_fade_time option (#508)
* config: add input-field dots_fade_time option
Time is in milliseconds. Anything <= 0 is immediate.

* input-field: change speedPerSecond to fadeMs
Default is 200ms, which is the same amount of time as the previous
5 speedPerSecond. Not sure using doubles is necessary, but I'm
using them to avoid precision issues.

Closes: https://github.com/hyprwm/hyprlock/issues/355
2024-10-10 22:20:14 +01:00
Maximilian Seidler
eb63207ef0
core: make attemptRestoreOnDeath faster and hyprland exclusive (#506)
* core: make attemptRestoreOnDeath hyprland exclusive

* core: destoy lock and sessionLockSurfaces in attemptRestoreOnDeath
2024-10-05 14:30:19 +01:00
davc0n
d9c2a5e0b7
widgets: add 12h time format (#500) 2024-09-30 12:22:24 +01:00
Maximilian Seidler
9ea804788c
core: set capslock and numlock states on startup (#496) 2024-09-25 09:56:20 +01:00
Yang, Ying-chao
153977aab3
asyncResourceGatherer: stop worker threads when application is going to exit (#481) 2024-09-05 12:27:43 +01:00
Yang, Ying-chao
0b030d33c8
asyncResourceGatherer: do not detach worker threads (#477)
Worker threads become non-joinable once they are detached, and `await()` will not wait for them to
finish. This can lead to a crash when `asyncResourceGatherer` is destroyed in the main thread while it
is still being used in worker threads.
2024-09-04 20:58:38 +01:00
André Silva
73b0fc26c0 nix: add wayland-scanner native build input 2024-09-01 18:19:54 +03:00
Darko Nikolić
cc71c0b7d9
core: fix symlinked images not picking up extension (#473) 2024-08-31 12:37:47 +02:00
Maximilian Seidler
9c1e9e7db2
core: support desc: prefix for widget monitor options (#470) 2024-08-29 12:36:07 +02:00
Maximilian Seidler
a0af542f9b
input-field: refactor updateColors and other improvements (#469)
* input-field: refactor updateColors

* input-field: fix input-field:invert_numlock

* input-field: use updatePlaceholder to request the initial placeholder asset

* input-field: allow more gradual color animations

* input-field: fix caps and num indicator colors, when borderless and swap_font_color is true
2024-08-29 09:53:00 +02:00
Yang, Ying-chao
7bb4113a7e
core: fix crash caused by exiting without joining running thread (#464) 2024-08-21 11:25:14 +01:00
Maximilian Seidler
f673759d01
lockSurface: fix dynamic output mode and scale updates (#462)
* lockSurface: reload widgets on output change

* lockSurface: only configure when scale actually changed

* lockSurface: enable fsv1 per default for all compositors
2024-08-18 08:19:56 +01:00
Maximilian Seidler
9393a3e94d
core: add fractional_scaling option (#456)
* config: add fractional_scaling option

0 -> off
1 -> on
2 -> auto

* core: default auto option for fractional_scaling

* locksurface: fallback to integer scaling
2024-08-05 20:22:01 +02:00
alba4k
8cffe0618c fix alignment in help message 2024-08-04 12:53:43 +03:00
Aaron Blasko
5d85ea03b0
renderer: add --no-fade-in (#453) 2024-08-03 17:34:54 +02:00
c7fa5026c0
assets: add example.conf 2024-08-02 21:39:54 +03:00
Maximilian Seidler
8a89181e69
auth: use pam_faillock log as $FAIL (#447)
Allows us to show "(x minutes left to unlock)" directly in the
input-field fail text.
2024-07-30 18:52:50 +02:00
davc0n
5e8f12c2d9
core: minor refactor of command line options parsing (#441) 2024-07-28 19:10:36 +01:00
Maximilian Seidler
cf0e975fed
widgets: move asset updates out of the draw function (#442)
* label: move asset updates out of the draw function

This allows us to check if the label has actually updated after the
callback from the asyncResourceGatherer. If it isn't we can requeue the
renderUpdate() function.

* image: move asset updates out of the draw function
2024-07-24 23:18:11 +02:00
Maximilian Seidler
3e71799b30
misc: add issue templates (#440)
* misc: add issue templates

Copied from Hyprland and slightly modified

* misc: but template --version and minor improvements

* misc: fix bug template closing tag
2024-07-24 17:52:15 +02:00
58e1a4a499 core: add --version 2024-07-24 13:58:59 +02:00
dba9d8b517 version: bump to 0.4.1 2024-07-21 14:00:28 +02:00
Maximilian Seidler
3d3b52e42c
asyncResourceGatherer: deduplicate image rendering code (#433)
* asyncResourceGatherer: deduplicate image rendering code

Also happens to add support for JPEG and WEBP for image widgets

* asyncResourceGatherer: use a reference for path in getFileType
2024-07-19 23:20:31 +02:00
Maximilian Seidler
20c01d91d4
core: make sure m_sLockState.lock is present in onLockFinished and releaseSessionLock (#432) 2024-07-19 17:26:38 +02:00
372a4cd55e
flake.lock: update 2024-07-18 20:46:51 +03:00
a29012cbbd
CMake: fmt 2024-07-18 20:46:31 +03:00
cac93f67e8
CMake, Nix: add VERSION file 2024-07-18 20:45:42 +03:00
Maximilian Seidler
9514925a7c
core: grace unlock improvements and auth fixes for grace/SIGUSR1 unlocks (#424)
* core: check m_bTerminate for grace unlocks

* core: remove reference to the lock object on finished

* core: add isUnlocked

true if m_bFadeStarted or m_bTerminate

* auth: return early on grace or SIGUSR1 unlocks
2024-07-17 15:22:42 +02:00
a3d8a2c128
Config: use hyprutils helper (#422)
* flake.lock: update

* gitignore: add CMake residual files

* config: use hyprutils helper

* CMake: update required hyprutils version
2024-07-16 22:35:48 +02:00
Maximilian Seidler
69d37d2663
core: immediately create session lock surfaces (#421)
* core: immediately create session lock surfaces

Instead of waiting for the `locked` event, create session lock surfaces
right away.

* core: don't allow unlock_and_destroy if `locked` has never been recieved
2024-07-14 16:59:06 +02:00
Maximilian Seidler
b407128cae
core: handle ext_session_lock_v1::finished as defined in the protocol (#418) 2024-07-11 16:15:32 +02:00
Maximilian Seidler
e5f0b56d07
asyncResourceGatherer: trace logs and exit behaviour (#414)
* asyncResourceGatherer: add trace logs

useful for debugging label updates

* label: remove unused onAssetCallbackTimer

* asyncResourceGatherer: fix crashes on exit
2024-07-10 12:05:18 +02:00
davc0n
944caff79f
config: add input-field fail_timeout option (#406)
* config: add input-field fail_timeout option

* config: change input-field fail_timeout to milliseconds

* input-field: fix configFailTimeoutMs type and init
2024-07-09 17:43:31 +02:00
Jasson
d8ccc6f96a
core: Label exception handling + Frambuffer checks + headers (#413)
* Added exception handling in label constructor

* Framebuffer fix + moved headers

* added optional header
2024-07-09 11:32:49 +02:00
Maximilian Seidler
3bedae4436
auth: don't start pam conversation before the initial input happens (#409)
After realizing that pam modules sometimes implement a timeout, i think
it is not worth starting the convo it right away.
Now you won't get the initial PAM_PROMPT any more.
Prompt will be initialized to "Password: ", which is most commonly what
you get from pam. Subsequent prompts (e.g. 2fa) will be handled however.
2024-07-08 14:25:06 +02:00
Davide Conti
e72f601209 readme: add official repo package to arch install 2024-07-08 14:15:10 +03:00
Maximilian Seidler
43f2b7441b
core: handle missing wayland protocol support (#408)
* core: check support of wp_factional_scale_manager_v1 and wp_viewporter

* core: check support of zwlr_screencopy_manager_v1
2024-07-07 21:44:53 +02:00
Maximilian Seidler
0552a1eddd
core: add option to render solid background immediatly when bg assets are not ready (#407)
* asyncResourceGatherer: start the asyncLoop at the same time as gather

This is a prerequesit for labels beeing drawn, while backgrounds are
note ready yet.

* core: allow immediate rendering even when backgrounds are not gathered yet

Note:
We don't really need to call `asyncResourceGatherer::apply` in the
`renderLock` function, since it will get called by a call to
`asyncResourceGatherer::getAssetById` anyways.

* background: render color rectangle when asset is not ready yet

* config: add general:immediate_render config option

* core: use the --immediate-render flag in attemptRestoreOnDeath
2024-07-07 18:43:17 +02:00
Jasson
a50296c181
core: minor bugfixes (#405) 2024-07-07 17:55:59 +02:00
Tom Englund
7fb3c03500
hyprlock: ensure members are accessed direct (#404)
if the unique_ptr is reset directly accessing it from the destructor
causes crashes on Clang/libc++, just access the members directly.
2024-07-06 12:24:29 +02:00
daywalker-dev
6e0921140e
helpers: fix jpeg and webp OOM error (#401)
* Update Jpeg.cpp

* Update Webp.cpp
2024-07-05 22:58:45 +02:00