add lock
This commit is contained in:
parent
22baf836ee
commit
e8738e504f
1 changed files with 63 additions and 17 deletions
|
|
@ -106,12 +106,54 @@ let
|
|||
}
|
||||
)
|
||||
}
|
||||
# Only locks before suspending, with hyprlock
|
||||
restart 'bin/hypridle ' ${lib.getExe pkgs.hypridle} --config ${pkgs.writeText "hypridle.conf" ''
|
||||
general {
|
||||
lock_cmd = pidof hyprlock || ${lib.getExe pkgs.hyprlock} --config ${
|
||||
let
|
||||
inherit (config.lib.stylix) colors;
|
||||
in
|
||||
pkgs.writeText "hyprlock.conf" ''
|
||||
|
||||
background {
|
||||
path = screenshot
|
||||
blur_passes = 3
|
||||
}
|
||||
|
||||
label {
|
||||
text = $TIME
|
||||
font_size = 96
|
||||
position = 0, 200
|
||||
}
|
||||
|
||||
label {
|
||||
text = cmd[update:60000] date +"%A, %B %-d"
|
||||
font_size = 20
|
||||
position = 0, 110
|
||||
}
|
||||
|
||||
input-field {
|
||||
size = 300, 50
|
||||
outline_thickness = 0
|
||||
inner_color = rgb(${colors.base01})
|
||||
font_color = rgb(${colors.base05})
|
||||
check_color = rgb(${colors.base0D})
|
||||
fade_on_empty = false
|
||||
}
|
||||
''
|
||||
}
|
||||
before_sleep_cmd = loginctl lock-session
|
||||
}
|
||||
''}
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ inputs.fht-compositor.nixosModules.default ];
|
||||
|
||||
# Tapping the power button suspends (which locks the screen, see hypridle above)
|
||||
services.logind.settings.Login.HandlePowerKey = "suspend";
|
||||
|
||||
# Prefer the GNOME portal (e.g. Nautilus as the file picker), falling back to GTK. This replaces
|
||||
# the portal config fht-compositor ships.
|
||||
xdg.portal.config.fht-compositor = {
|
||||
|
|
@ -331,7 +373,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
programs.fht-compositor = {
|
||||
programs = {
|
||||
hyprlock.enable = true;
|
||||
|
||||
fht-compositor = {
|
||||
enable = true;
|
||||
package =
|
||||
inputs.fht-compositor.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs
|
||||
|
|
@ -349,4 +394,5 @@ in
|
|||
'';
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue