Commit graph

287 commits

Author SHA1 Message Date
Maximilian Seidler
8a13e97ee0 config: add sizex using CLayoutXValueData for reproducible layouting of image and label
BREAKING: removed image:size in favour of image:sizex
2024-12-19 14:57:56 +01:00
Jan Beich
d12b4a7fba
pam: add missing header for libc++ after a4b0562749 (#589)
In file included from src/auth/Auth.cpp:2:
src/auth/Pam.hpp:43:5: error: no type named 'thread' in namespace 'std'; did you mean 'pthread'?
   43 |     std::thread           m_thread;
      |     ^~~~~~~~~~~
      |     pthread
2024-12-18 20:10:01 +01:00
Robin Carlier
058830668e
widgets: Reload backgrounds and not just images (#583)
* widgets: Reload background and fade

* clang-format

also clang-format

* undo possibly unwanted format on Renderer.hpp

* rename stuff + style

* codestyle + initialize reloadTime

* remove trailing eols
2024-12-18 16:28:05 +01:00
381a284b3b version: bump to 0.6.0 2024-12-18 15:03:04 +00:00
Maximilian Seidler
fe35a8068c
core: terminate auth after recieving finished (#586) 2024-12-18 15:52:35 +01:00
Austin Horstman
61be0cb652
nix/overlays: gcc13 -> gcc14; flake.lock: update (#584)
* nix/overlays: gcc13 -> gcc14

* flake.lock: update
2024-12-16 22:24:00 +01:00
Maximilian Seidler
a4b0562749
auth: add an interface for different authentication methods (#578)
* auth: add an interface for different authentication methods

* auth: pick inline feedback based on last active implementation

* config: move auth options to auth:<auth_impl>

BREAKING:
- general:pam_module -> auth:pam:module
- general:enable_fingerprint -> auth:fingerprint:enabled
- general:fingerprint_ready_message -> auth:fingerprint:ready_message
- general:fingerprint_present_message ->
auth:fingerprint:present_message

* auth: don't clear password input for fingerprint auth check

* fingerprint: checkAuthenticated when handling verfiy status

* Revert conditionally clearing the password input buffer

Makes sure the input field can show the fail text for fingerprint auth.

* auth: virtual instead of override, remove braces

* pam: join the thread

* auth: remove isAuthenticated and switch to a control flow based unlock

* auth: initialize authentication before aquiring the session lock
2024-12-16 19:58:36 +01:00
Maximilian Seidler
4681f8f7f3
input-field: fix width animations (#582) 2024-12-16 01:00:41 +01:00
Maximilian Seidler
8010b81e7b
core: move to Hyprutils::OS::CProcess for spawning processes (#575)
* core: move to Hyprutils::OS::CProcess for spawning processes

* nix: flake update
2024-12-08 16:42:16 +01:00
Maximilian Seidler
cc7ffe73e7
renderer: round boxes (#571)
* renderer: round boxes before matrix projection

* renderer: use rounded boxes throughout
2024-12-01 17:13:55 +00:00
Vaxry
4667f721be
Core: move to hyprgraphics (#570)
* core: move to hyprgraphics

* Nix: add hyprgraphics

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2024-11-28 16:43:11 +00:00
Maximilian Seidler
578246b996
config: use removeEmpty for the gradient varlist (#565) 2024-11-19 13:35:53 +00:00
Maximilian Seidler
b9cf5151ba
input-field: fix colorConfig caps, num and both when they are empty (#559) 2024-11-15 00:45:55 +00:00
Maximilian Seidler
d159e14e5b
config: make configStringToInt support rgb(a) with decimal values (#558) 2024-11-15 00:43:47 +00:00
Maximilian Seidler
2775ab2868
widgets: render frambuffers with alpha 1.0 (#554)
* helpers: update CColor

yoinked from Hyprland

* image: fix border alpha

* shape: fix border alpha
2024-11-12 13:31:27 +00:00
c3c28feb4c widget: show 12AM instead of 0AM 2024-11-11 15:58:49 +00:00
eadcbc0aed widget: fix time12 when it's 12pm
fixes #552
2024-11-11 15:58:11 +00:00
Maximilian Seidler
d8bd25b52d
core: add support for composed keys (#551) 2024-11-11 15:49:51 +00:00
Maximilian Seidler
6c3c444136
core: add border shader and border gradients (#548)
* renderer: add renderBorder function

* config: add CGradientValueData from Hyprland

* input-field: change outer to take gradients

Added gradient support to the following color options:
- `outer_color`
- `fail_color`
- `check_color`
- `capslock_color`
- `numlock_color`
- `bothlock_color``

* image: add gradient border

* shape: add gradient border

* shaders: adapt the new rounded smoothing factor from Hyprland
2024-11-09 16:54:44 +00:00
Maximilian Seidler
4fc133c96f
widgets: add support for specifing size and position options via percentages of output dimensions (#541)
* config: introduce a custom value type for layout related options

* widgets: use CLayoutValueData for size and position options

* widgets: catch bad_any_cast and out_of_range when contructing widgets other than label

* config: rename and restrict CLayoutValueData::fromAny to fromAnyPv

This is only for casting `any` variables that represent a void * to a
CLayoutValueData*, not just any any.

* misc: remove debug prints
2024-11-06 16:50:42 +00:00
moggiesir
1cd3231537
auth: make fingerprint initialization async (#544) 2024-11-05 13:12:26 +00:00
Maximilian Seidler
f225e23e5b
misc: make Debug::log flush stdout (#542)
Makes it a lot easier to spot a failed RASSERT
2024-11-02 23:42:39 +00:00
Maximilian Seidler
edbecc8708
widgets: remove debug remnants from #527 (#532) 2024-10-27 18:33:05 +00:00
Maximilian Seidler
29dd33d6a4
widgets: check current_zone pointer (#527)
* widgets: check current_zone pointer and fallback to utc

* misc: remove redundant printf in RASSERT

* widgets: no curly else
2024-10-26 19:27:24 +01:00
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