Commit graph

56 commits

Author SHA1 Message Date
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
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
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
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
Maximilian Seidler
f13d97e6d6
config: make the default widget position be 0,0 (#529) 2024-10-25 22:02:47 +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
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
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
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
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
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
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
Maximilian Seidler
01bf48ed96
config: don't crash when getenv HOME returns null (#398) 2024-07-05 22:41:03 +02:00
davc0n
5b19c6307a
config: Remove dupe input-field rounding from listKeysForSpecialCategory (#395) 2024-07-03 23:50:07 +02:00
shezdy
997f222b0f
core: add zindex option to widgets (#334)
* add zheight

* move sort to renderer

* fix format

* change name to zindex
2024-05-17 19:29:05 +01:00
davc0n
c87af3aa1f
renderer: add text trim with option to disable (#310)
* renderer: add text trim with option to disable

* refactor: format CAsyncResourceGatherer::renderText

* config: change disable_text_trim to text_trim
2024-05-04 18:18:27 +01:00
bvr-yr
04267a5f83
label: add text_align option for multi-line text (#278) 2024-04-13 14:38:06 +01:00
Maximilian Seidler
6fa65e1172
input-field: increase default fade_timeout (#276) 2024-04-11 19:57:46 +01:00
Maximilian Seidler
883fbdfe01
auth: implement a full pam conversation (#205)
* auth: implement a full pam conversation

* input-field: fixup failedAttempts and color change

Credits to @bvr-yr

* pam: set default module to hyprland

* input-field: backup previous asset

* auth: restart auth in onPasswordCheckTimer

* auth: immediately switch to waiting when input was submitted

* auth: remove redundant waitingForPamAuth

* auth: add inputRequested and reschedule submitInput

* auth: clear password buffer and handle submitInput before input is requested

* Revert "input-field: backup previous asset"

This reverts commit 89702945be6af4aa43f54688ad34a4ccba994a3e.

Without the backup we avoid rendering the prompt placeholder for one frame when the failText is not available.
Looks better this way.

* auth: fallback to su if pam_module not in /etc/pam.d

rare occasion where a path check even works on nix

* auth: rename inputSubmitted and resubmit callback

* auth: detach failText from the conversation

* fix rebase mistake

* auth: make sure prompt and failText are not reset when restarting auth

needed for labels

* auth: force update timers when the prompt changes

* auth: remove unused stuff
2024-04-10 22:41:31 +01:00
bvr-yr
eb1123fa2e
widgets: add Shape + minor image improve (#266)
* widgets: add Shape

* image: minor improvment

* glClear on FB alloc

* add Nix HM

* always create FB if not xray
2024-04-10 17:24:17 +01:00
bvr-yr
bbbb960e42
image: add reload options (#247)
* image: add reload options

* check for actual file changes

* use modtime

* check only same paths

* add Nix HM
2024-04-07 18:09:25 +01:00
bvr-yr
84c6282d6a
widgets: add rotate option to label and image (#234)
* widgets: add `rotate` option to label and image

* use framebuffer for image
2024-03-29 19:01:11 +00:00
YoussefAswad
230f8aadb5
config: add option to ignore empty input (#218) 2024-03-23 15:02:03 +00:00
bvr-yr
1bf6ffdbe2
input-field: new color features (#201)
* input-field: new color features

* add nix HM

* add workaround for faillasset not being shown on empty imput

* comment

* change cfg option name

* remove TODO

* small fix

* one more edge check

* dedup changeColor function

* simplify more
2024-03-19 02:46:52 +00:00
bvr-yr
1356f113cc
config: add -c, --config commandline options (#202)
* config: add -c, --config commandline options

* argc

* don't allow missing custom config file
2024-03-18 15:04:39 +00:00
bvr-yr
3e38762e84
widgets: add Image (#191) 2024-03-16 16:44:44 +02:00
Abhinav Anil
1c92c6109c
renderer: add fade out animation and property to disable (#188)
* renderer, Nix/HM module: add fade out animation and prop

* fix: fade duration and disable on non hyprland session

* fix: revert needsFrame condition, update duration to 500ms

* fix: make shadows obey widget opacity
2024-03-14 13:23:41 +00:00
bvr-yr
f3a41161ec
input-field: add capslock and numlock options (#182)
* input-field: add capslock and numlock options

* fixups

* Nix/HM module: add {caps,num}lock options

---------

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2024-03-13 01:10:42 +00:00
bvr-yr
6c9d6f05a0
input-field: check_color + some fixes (#172) 2024-03-11 15:17:14 +00:00
Maximilian Seidler
0f44f76368
misc: path handling improvements (#163)
* misc: use weakly_canonical for absolutePath

* misc: make absolutePath not optional

* misc: use currentDir as the argument to absolutePath

* config: avoid circular imports
2024-03-10 14:37:25 +00:00
bvr-yr
149b6737c2
input-field: fail display improvments (#154)
* input-field: fail display improvments

* update Home Manager

* add `$ATTEMPTS` variable, change defaults

* nix wording

* log failed attempts
2024-03-09 16:44:58 +00:00
Maximilian Seidler
3d6162e06e
input-field: Add fade out timeout #3 (#142)
* input-field: add fade out timeout

* input-field: let dots reset themselfs

Now the dots kind of fade into the placeholder text on a failure.

* Nix/HM module: add input-field:fade_timeout option
2024-03-06 21:12:49 +00:00
9b54840e12 shadows: disable by default 2024-03-05 20:28:29 +00:00
a4dc596cb8 renderer: add shadowable props 2024-03-05 20:27:28 +00:00
bvr-yr
d1f542a75f
input-field: add dots rounding option (#130)
* refactor: move dot props to struct, rename to camelCase

* input-field: add dots rounding option

* render: minor fix for odd input-field width

* add dots_rounding option to Home Manager
2024-03-04 17:59:36 +00:00
matteo4375
49ef1d306c
input-field: Add rounding option (#127)
* input-field: add rounding option

* add rounding option to nix home manager module
2024-03-04 01:54:27 +00:00
Gonçalo Negrier Duarte
57e8000660
core: fix libc++ compatibility (#75)
src/config/ConfigManager.cpp:91:6: error: no type named 'mutex' in namespace 'std'
   91 | std::mutex   configMtx;
      | ~~~~~^
src/config/ConfigManager.cpp:94:10: error: no member named 'lock_guard' in namespace 'std'
   94 |     std::lock_guard<std::mutex> lg(configMtx);
      |     ~~~~~^
/var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/src/config/ConfigManager.cpp:94:26: error: no member named 'mutex' in namespace 'std'
   94 |     std::lock_guard<std::mutex> lg(configMtx);
      |                     ~~~~~^

Closes: https://github.com/hyprwm/hyprlock/issues/43

Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
2024-02-24 02:54:15 +00:00
57ce4f759c config: add no_fade_in
fixes #55
2024-02-22 00:36:01 +00:00
Maurice Kraus
2fc23cbfc8
config: add source parsing (#28)
* config: add source parsing

* config: add nested source parsing

* config: streamlined absolutePath impl
2024-02-21 23:52:12 +00:00
1b57d52179 background: add blurring 2024-02-21 22:21:16 +00:00
6355216f48 config: add general:grace
fixes #48
2024-02-21 16:48:59 +00:00
b1ffd73534 input-field: add dots_center 2024-02-21 11:42:18 +00:00
bvr-yr
d28e009c55
input-field: allow configure dots size (#24) 2024-02-20 17:12:43 +00:00
6ff808cebf input-field: add hide_input 2024-02-20 14:42:10 +00:00
868e85e362 config: add general:hide_cursor 2024-02-20 02:54:19 +00:00
c60b7b8aef input-field: add placeholder 2024-02-19 22:58:59 +00:00