Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f371b6ab1 | ||
|
|
2666a84516 |
No files matched your search
@@ -162,15 +162,23 @@
|
||||
# open-fprintd, so a successful ListEnrolledFingers call means the sensor is
|
||||
# usable. This is used as ExecStartPost and by greetd ordering.
|
||||
waitForFprint = pkgs.writeShellScript "wait-for-fprint" ''
|
||||
for ((i = 0; i < 80; i++)); do
|
||||
if ${timeout} 1 ${fprintdList} root >/dev/null 2>&1; then
|
||||
for ((i = 0; i < 120; i++)); do
|
||||
|
||||
devices="$(${timeout} 1 ${busctl} --system call \
|
||||
net.reactivated.Fprint \
|
||||
/net/reactivated/Fprint/Manager \
|
||||
net.reactivated.Fprint.Manager GetDevices 2>/dev/null || true)"
|
||||
|
||||
if [[ "$devices" =~ ^ao\ [1-9] ]]; then
|
||||
echo "wait-for-fprint: sensor initialized: $devices"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
${sleep} 0.5
|
||||
done
|
||||
|
||||
echo "wait-for-fprint: fingerprint backend did not become ready" >&2
|
||||
exit 0
|
||||
echo "wait-for-fprint: sensor initialization timeout" >&2
|
||||
exit 1
|
||||
'';
|
||||
|
||||
# The xHCI controller is reset during resume, which invalidates
|
||||
|
||||
@@ -6,8 +6,22 @@ let
|
||||
hyprctl = lib.getExe' config.wayland.windowManager.hyprland.package "hyprctl";
|
||||
loginctl = lib.getExe' pkgs.systemd "loginctl";
|
||||
pidof = lib.getExe' pkgs.procps "pidof";
|
||||
fprintdList = lib.getExe' pkgs.fprintd "fprintd-list";
|
||||
timeout = lib.getExe' pkgs.coreutils "timeout";
|
||||
sleepCmd = lib.getExe' pkgs.coreutils "sleep";
|
||||
sh = lib.getExe pkgs.bash;
|
||||
|
||||
hyprlockWait = pkgs.writeShellScript "hyprlock-wait-fprint" ''
|
||||
for i in $(seq 1 60); do
|
||||
if ${timeout} 1 ${fprintdList} kirill >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
${sleepCmd} 1
|
||||
done
|
||||
exec ${hyprlock}
|
||||
'';
|
||||
in {
|
||||
wayland.windowManager.hyprland.settings.on = [ (hyprLua.onStart [ "hyprlock" ]) ];
|
||||
wayland.windowManager.hyprland.settings.on = [ (hyprLua.onStart [ "${hyprlockWait}" ]) ];
|
||||
|
||||
# Hypridle listens to logind's PrepareForSleep signal: it locks the session
|
||||
# before suspend and makes sure hyprlock is running (and the display is on)
|
||||
@@ -16,9 +30,9 @@ in {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "${pidof} hyprlock >/dev/null || ${hyprlock}";
|
||||
lock_cmd = "${pidof} hyprlock >/dev/null || ${hyprlockWait}";
|
||||
before_sleep_cmd = "${loginctl} lock-session";
|
||||
after_sleep_cmd = "${pidof} hyprlock >/dev/null || ${hyprlock} & ${hyprctl} dispatch 'hl.dsp.dpms({action = \"on\"})'";
|
||||
after_sleep_cmd = "${pidof} hyprlock >/dev/null || ${hyprlockWait} & ${hyprctl} dispatch 'hl.dsp.dpms({action = \"on\"})'";
|
||||
};
|
||||
|
||||
# Hypridle requires at least one listener, so keep a no-op timer that
|
||||
|
||||
Reference in new issue
Block a user