Skip to content

Commit 590236f

Browse files
committed
Added dynamic fingerprint support.
1 parent a27bd70 commit 590236f

9 files changed

Lines changed: 224 additions & 56 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1919
- Waybar: waybar now uses systemd run instead of app2unit to handle env properly.
2020
- Updated the hyde-config binary
2121
- Python-env: Deprecate pip and use uv instead.
22+
- Hypr: Removed '~/.config/hypr/hyde.conf' as it is not being used or a long time now. Please use the 'config.toml' instead
23+
- hyprlock: Added options under [hyprlock]: hide_cursor,ignore_empty_input,immediate_render,text_trim,fractional_scaling,screencopy_mode,fail_timeout. See https://wiki.hypr.land/Hypr-Ecosystem/hyprlock/
24+
2225

2326
### Added
2427
- Window: added 'hyde-shell window.mute' to toggle window audio. This is a python implementation for 'wl-togglesink'
@@ -30,8 +33,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
3033

3134

3235

33-
34-
3536
### Fixed
3637
- Weather: Fix [#1664](https://github.com/HyDE-Project/HyDE/issues/1664)
3738
- Waybar: #

Configs/.config/hypr/hyprlock/HyDE.conf

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ input-field {
8181
bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above)
8282
invert_numlock = false # change color if numlock is off
8383
swap_font_color = true # see below
84-
position = 0, 80
84+
position = 0, 4.5%
8585
halign = center
8686
valign = bottom
8787
}
@@ -176,3 +176,23 @@ label {
176176
halign = right
177177
valign = bottom
178178
}
179+
180+
# Added Fingerprint Prompts
181+
182+
label {
183+
text = $FPRINTPROMPT
184+
color = $wallbash_txt2_rgba
185+
font_size = 16
186+
position = 0, 2%
187+
halign = center
188+
valign = bottom
189+
}
190+
191+
label {
192+
text = $FPRINTFAIL
193+
color = rgba(FF7070FF)
194+
font_size = 14
195+
position = 0, 5%
196+
halign = center
197+
valign = bottom
198+
}

Configs/.local/lib/hyde/hyprlock.sh

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ fn_profile() {
3838
return 0
3939
}
4040
fn_mpris() {
41-
local player=${1:-$(playerctl --list-all 2> /dev/null | head -n 1)}
41+
local player=${1:-$(playerctl --list-all 2>/dev/null | head -n 1)}
4242
THUMB="$cacheDir/landing/mpris"
43-
player_status="$(playerctl -p "$player" status 2> /dev/null)"
43+
player_status="$(playerctl -p "$player" status 2>/dev/null)"
4444
if [[ $player_status == "Playing" ]]; then
4545
playerctl -p "$player" metadata --format "{{xesam:title}} $(mpris_icon "$player") {{xesam:artist}}"
4646
mpris_thumb "$player"
@@ -62,13 +62,13 @@ fn_mpris() {
6262
mpris_icon() {
6363
local player=${1:-default}
6464
declare -A player_dict=(
65-
["default"]=""
66-
["spotify"]=""
67-
["firefox"]=""
68-
["vlc"]=""
69-
["google-chrome"]=""
70-
["opera"]=""
71-
["brave"]="")
65+
["default"]=""
66+
["spotify"]=""
67+
["firefox"]=""
68+
["vlc"]=""
69+
["google-chrome"]=""
70+
["opera"]=""
71+
["brave"]="")
7272
for key in "${!player_dict[@]}"; do
7373
if [[ $player == "$key"* ]]; then
7474
echo "${player_dict[$key]}"
@@ -81,7 +81,7 @@ mpris_thumb() {
8181
local player=${1:-""}
8282
artUrl=$(playerctl -p "$player" metadata --format '{{mpris:artUrl}}')
8383
[ "$artUrl" == "$(cat "$THUMB".lnk)" ] && [ -f "$THUMB".png ] && exit 0
84-
echo "$artUrl" > "$THUMB".lnk
84+
echo "$artUrl" >"$THUMB".lnk
8585
curl -Lso "$THUMB.art" "$artUrl"
8686
magick "$THUMB.art" -quality 50 "$THUMB.png"
8787
reload_hyprlock
@@ -92,7 +92,7 @@ fn_cava() {
9292
config_file="$XDG_RUNTIME_DIR/hyde/cava.hyprlock"
9393
if [ "$(pgrep -c -f "cava -p $config_file")" -eq 0 ]; then
9494
trap 'rm -f ${tempFile}' EXIT
95-
"${LIB_DIR}/hyde/cava.py" hyprlock > $tempFile 2>&1
95+
"${LIB_DIR}/hyde/cava.py" hyprlock >$tempFile 2>&1
9696
fi
9797
}
9898
fn_art() {
@@ -105,7 +105,7 @@ find_filepath() {
105105
"${XDG_CONFIG_HOME:-$HOME/.config}/hyde/hyprlock"
106106
"$HYPRLOCK_CONF_DIR")
107107
print_log -sec "hyprlock" -stat "Searching for layout" "$filename"
108-
find "${search_dirs[@]}" -type f -name "$filename*" 2> /dev/null | head -n 1
108+
find "${search_dirs[@]}" -type f -name "$filename*" 2>/dev/null | head -n 1
109109
}
110110
fn_select() {
111111
font_scale="$ROFI_HYPRLOCK_SCALE"
@@ -120,14 +120,14 @@ fn_select() {
120120
hypr_width=${hypr_width:-"$(hyprctl -j getoption general:border_size | jq '.int')"}
121121
r_override="window{border:${hypr_width}px;border-radius:${wind_border}px;} wallbox{border-radius:${elem_border}px;} element{border-radius:${elem_border}px;}"
122122
layout_dir="$confDir/hypr/hyprlock"
123-
layout_items=$(find -L "$layout_dir" -name "*.conf" ! -name "theme.conf" 2> /dev/null | sed 's/\.conf$//')
123+
layout_items=$(find -L "$layout_dir" -name "*.conf" ! -name "theme.conf" 2>/dev/null | sed 's/\.conf$//')
124124
if [ -z "$layout_items" ]; then
125125
notify-send -i "preferences-desktop-display" "Error" "No .conf files found in $layout_dir"
126126
exit 1
127127
fi
128128
layout_items="Theme Preference
129129
$layout_items"
130-
selected_layout=$(awk -F/ '{print $NF}' <<< "$layout_items" | rofi -dmenu -i -select "$HYPRLOCK_LAYOUT" \
130+
selected_layout=$(awk -F/ '{print $NF}' <<<"$layout_items" | rofi -dmenu -i -select "$HYPRLOCK_LAYOUT" \
131131
-p "Select hyprlock layout" \
132132
-theme-str 'entry { placeholder: "🔒 Hyprlock Layout..."; }' \
133133
-theme-str "$font_override" \
@@ -152,21 +152,21 @@ $layout_items"
152152
}
153153
check_and_sanitize_process() {
154154
local unit_name="${1:-$HYPRLOCK_SCOPE_NAME}"
155-
if systemctl --user is-active "$unit_name" > /dev/null 2>&1; then
156-
systemctl --user stop "$unit_name" > /dev/null 2>&1
155+
if systemctl --user is-active "$unit_name" >/dev/null 2>&1; then
156+
systemctl --user stop "$unit_name" >/dev/null 2>&1
157157
fi
158158
}
159159
reload_hyprlock() {
160160
local unit_name="${2:-$HYPRLOCK_SCOPE_NAME}"
161-
if systemctl --user is-active "$unit_name" > /dev/null 2>&1; then
162-
systemctl --user kill -s USR2 "$HYPRLOCK_SCOPE_NAME" > /dev/null 2>&1
161+
if systemctl --user is-active "$unit_name" >/dev/null 2>&1; then
162+
systemctl --user kill -s USR2 "$HYPRLOCK_SCOPE_NAME" >/dev/null 2>&1
163163
else
164-
pkill -USR2 hyprlock > /dev/null 2>&1
164+
pkill -USR2 hyprlock >/dev/null 2>&1
165165
fi
166166
}
167167
append_label_to_file() {
168168
local file="$1"
169-
cat << EOF >> "$file"
169+
cat <<EOF >>"$file"
170170
label {
171171
text = PREVIEW! Press a key or swipe to exit.
172172
color = rgba(\$wallbash_txt122)
@@ -233,8 +233,8 @@ rofi_test_preview() {
233233
generate_conf() {
234234
local path="${1:-$confDir/hypr/hyprlock/theme.conf}"
235235
local target_file="${2:-$confDir/hypr/hyprlock.conf}"
236-
local hyde_hyprlock_conf=${SHARE_DIR:-$XDG_DATA_HOME}/hyde/hyprlock.conf
237-
cat << CONF > "$target_file"
236+
local hyde_hyprlock_conf=${SHARE_DIR:-$XDG_DATA_HOME}/hypr/hyprlock.conf
237+
cat <<CONF >"$target_file"
238238
#! █░█ █▄█ █▀█ █▀█ █░░ █▀█ █▀▀ █▄▀
239239
#! █▀█ ░█░ █▀▀ █▀▄ █▄▄ █▄█ █▄▄ █░█
240240
@@ -374,18 +374,18 @@ argparse "--test-preview" "TEST_PREVIEW_LAYOUT" "Test preview layout" "parameter
374374
argparse_finalize
375375

376376
case "$ARGPARSE_ACTION" in
377-
background) fn_background ;;
378-
profile) fn_profile ;;
379-
mpris) fn_mpris "$MPRIS_PLAYER" ;;
380-
cava) fn_cava ;;
381-
art) fn_art ;;
382-
select) fn_select ;;
383-
test) layout_test "$TEST_LAYOUT" ;;
384-
test-preview) rofi_test_preview "$TEST_PREVIEW_LAYOUT" ;;
385-
*)
386-
ensure_lockscreen_bg_exist
387-
check_and_sanitize_process
388-
"${LIB_DIR}/hyde/app2unit.sh" -u "$HYPRLOCK_SCOPE_NAME" -t scope -- hyprlock
389-
exit 0
390-
;;
377+
background) fn_background ;;
378+
profile) fn_profile ;;
379+
mpris) fn_mpris "$MPRIS_PLAYER" ;;
380+
cava) fn_cava ;;
381+
art) fn_art ;;
382+
select) fn_select ;;
383+
test) layout_test "$TEST_LAYOUT" ;;
384+
test-preview) rofi_test_preview "$TEST_PREVIEW_LAYOUT" ;;
385+
*)
386+
ensure_lockscreen_bg_exist
387+
check_and_sanitize_process
388+
"${LIB_DIR}/hyde/app2unit.sh" -u "$HYPRLOCK_SCOPE_NAME" -t scope -- hyprlock
389+
exit 0
390+
;;
391391
esac

Configs/.local/share/hyde/schema/config.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,20 @@ Hyprland start configuration.
206206
| wallpaper | Wallpaper script. | hyde-shell app -u hyde-$XDG_SESSION_DESKTOP-wallpaper.service -t service -- wallpaper.sh --start --global |
207207
| xdg_portal_reset | XDG portal reset script. | hyde-shell resetxdgportal.sh |
208208

209+
### [hyprlock]
210+
211+
hyprlock configuration.
212+
213+
| Key | Description | Default |
214+
| --- | ----------- | ------- |
215+
| fail_timeout | Milliseconds until the UI resets after a failed auth attempt. | 2000 |
216+
| fractional_scaling | Whether to use fractional scaling. 0: disabled, 1: enabled, 2: auto. | 2 |
217+
| hide_cursor | Hides the cursor instead of making it visible. | false |
218+
| ignore_empty_input | Skips validation when no password is provided. | false |
219+
| immediate_render | Makes hyprlock immediately start to draw widgets. | false |
220+
| screencopy_mode | Selects screencopy mode: 0 gpu accelerated, 1 cpu based (slow). | 0 |
221+
| text_trim | Sets if the text should be trimmed, useful to avoid trailing newline in commands output. | true |
222+
209223
### [mediaplayer]
210224

211225
mediaplayer.py configuration.
@@ -305,7 +319,7 @@ glyph-picker.sh configuration.
305319

306320
### [rofi.hyprlock]
307321

308-
'hyprlock.sh select' configuration.
322+
'hyde-shell hyprlock select' configuration.
309323

310324
| Key | Description | Default |
311325
| --- | ----------- | ------- |

Configs/.local/share/hyde/schema/config.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ transition_default = "grow" # Transition type for default wallpaper.
2020
# Global rofi configuration.
2121
[rofi]
2222
scale = 10 # Rofi default scaling.
23-
# 'hyprlock.sh select' configuration.
23+
# 'hyde-shell hyprlock select' configuration.
2424
[rofi.hyprlock]
2525
scale = 10 # Scaling for hyprlock.
2626

@@ -202,6 +202,16 @@ steps = 5 # Number of steps to increase/decrease brightness.
202202
execute = "" # Default command to execute.
203203
commands = [""] # Fallback command options.
204204

205+
# hyprlock configuration.
206+
[hyprlock]
207+
hide_cursor = false # Hides the cursor instead of making it visible.
208+
ignore_empty_input = false # Skips validation when no password is provided.
209+
immediate_render = false # Makes hyprlock immediately start to draw widgets.
210+
text_trim = true # Sets if the text should be trimmed, useful to avoid trailing newline in commands output.
211+
fractional_scaling = 2 # Whether to use fractional scaling. 0: disabled, 1: enabled, 2: auto.
212+
screencopy_mode = 0 # Selects screencopy mode: 0 gpu accelerated, 1 cpu based (slow).
213+
fail_timeout = 2000 # Milliseconds until the UI resets after a failed auth attempt.
214+
205215
# Notification script configuration.
206216
[notification]
207217
font = "mononoki Nerd Font" # Font for notifications.

Configs/.local/share/hyde/schema/config.toml.json

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"type": "integer"
6969
},
7070
"hyprlock": {
71-
"description": "'hyprlock.sh select' configuration.",
71+
"description": "'hyde-shell hyprlock select' configuration.",
7272
"type": "object",
7373
"properties": {
7474
"scale": {
@@ -842,6 +842,56 @@
842842
}
843843
}
844844
},
845+
"hyprlock": {
846+
"description": "hyprlock configuration.",
847+
"type": "object",
848+
"properties": {
849+
"hide_cursor": {
850+
"default": false,
851+
"description": "Hides the cursor instead of making it visible.",
852+
"type": "boolean"
853+
},
854+
"ignore_empty_input": {
855+
"default": false,
856+
"description": "Skips validation when no password is provided.",
857+
"type": "boolean"
858+
},
859+
"immediate_render": {
860+
"default": false,
861+
"description": "Makes hyprlock immediately start to draw widgets.",
862+
"type": "boolean"
863+
},
864+
"text_trim": {
865+
"default": true,
866+
"description": "Sets if the text should be trimmed, useful to avoid trailing newline in commands output.",
867+
"type": "boolean"
868+
},
869+
"fractional_scaling": {
870+
"default": 2,
871+
"description": "Whether to use fractional scaling. 0: disabled, 1: enabled, 2: auto.",
872+
"options": [
873+
0,
874+
1,
875+
2
876+
],
877+
"type": "integer"
878+
},
879+
"screencopy_mode": {
880+
"default": 0,
881+
"description": "Selects screencopy mode: 0 gpu accelerated, 1 cpu based (slow).",
882+
"options": [
883+
0,
884+
1
885+
],
886+
"type": "integer"
887+
},
888+
"fail_timeout": {
889+
"default": 2000,
890+
"description": "Milliseconds until the UI resets after a failed auth attempt.",
891+
"type": "integer"
892+
}
893+
}
894+
},
845895
"notification": {
846896
"description": "Notification script configuration.",
847897
"type": "object",

Configs/.local/share/hyde/schema/schema.toml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type = "object"
8282
type = "integer"
8383

8484
[properties.rofi.properties.hyprlock]
85-
description = "'hyprlock.sh select' configuration."
85+
description = "'hyde-shell hyprlock select' configuration."
8686
type = "object"
8787

8888
[properties.rofi.properties.hyprlock.properties.scale]
@@ -733,6 +733,47 @@ type = "object"
733733
[properties.sysmonitor.properties.commands.items]
734734
type = "string"
735735

736+
[properties.hyprlock]
737+
description = "hyprlock configuration."
738+
type = "object"
739+
740+
[properties.hyprlock.properties.hide_cursor]
741+
default = false
742+
description = "Hides the cursor instead of making it visible."
743+
type = "boolean"
744+
745+
[properties.hyprlock.properties.ignore_empty_input]
746+
default = false
747+
description = "Skips validation when no password is provided."
748+
type = "boolean"
749+
750+
[properties.hyprlock.properties.immediate_render]
751+
default = false
752+
description = "Makes hyprlock immediately start to draw widgets."
753+
type = "boolean"
754+
755+
[properties.hyprlock.properties.text_trim]
756+
default = true
757+
description = "Sets if the text should be trimmed, useful to avoid trailing newline in commands output."
758+
type = "boolean"
759+
760+
[properties.hyprlock.properties.fractional_scaling]
761+
default = 2
762+
description = "Whether to use fractional scaling. 0: disabled, 1: enabled, 2: auto."
763+
options = [ 0, 1, 2 ]
764+
type = "integer"
765+
766+
[properties.hyprlock.properties.screencopy_mode]
767+
default = 0
768+
description = "Selects screencopy mode: 0 gpu accelerated, 1 cpu based (slow)."
769+
options = [ 0, 1 ]
770+
type = "integer"
771+
772+
[properties.hyprlock.properties.fail_timeout]
773+
default = 2000
774+
description = "Milliseconds until the UI resets after a failed auth attempt."
775+
type = "integer"
776+
736777
[properties.notification]
737778
description = "Notification script configuration."
738779
type = "object"
@@ -1231,3 +1272,5 @@ type = "object"
12311272
default = "  "
12321273
description = "Separator symbols to display between artist and track."
12331274
type = "string"
1275+
1276+

0 commit comments

Comments
 (0)