NixOS-Config/modules/home/sway/swaylock/default.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

2024-10-15 02:40:43 -04:00
{ pkgs, config, ... }:
2024-10-09 03:36:08 -04:00
let
default = "#${config.look.colors.prime}FF";
wrong = "#${config.look.colors.split}FF";
verifying = "#${config.look.colors.accent}FF";
blank = "#00000000";
clear = "#FFFFFF22";
text = "#FFFFFFFF";
in {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
clock = true;
image = "~/.assets/lockscreen/lock.png";
font = config.look.fonts.main;
font-size = 30;
timestr = "%I:%M%p";
datestr = "%a %b %d %Y";
key-hl-color = verifying;
bs-hl-color = wrong;
ring-clear-color = clear;
ring-ver-color = verifying;
ring-wrong-color = wrong;
ring-color = default;
inside-color = clear;
inside-ver-color = clear;
inside-wrong-color = clear;
inside-clear-color = clear;
2024-08-24 22:16:51 -04:00
text-color = text;
text-clear-color = text;
text-ver-color = text;
text-caps-lock-color = text;
text-wrong-color = text;
2024-08-24 22:16:51 -04:00
indicator = true;
indicator-radius = 80;
};
};
home.packages = with pkgs; [
(pkgs.writeScriptBin "swaysleep" ''
swaylock & ${pkgs.swayidle}/bin/swayidle -w \
2024-08-24 22:16:51 -04:00
timeout 1 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"; pkill -9 swayidle'
'')
2024-08-24 22:16:51 -04:00
];
# Enable Swaylock on startup
wayland.windowManager.sway.config.startup = [
{ command = "swaylock"; }
];
2024-08-24 22:16:51 -04:00
}