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

58 lines
1.4 KiB
Nix

{ pkgs, config, ... }:
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;
text-color = text;
text-clear-color = text;
text-ver-color = text;
text-caps-lock-color = text;
text-wrong-color = text;
indicator = true;
indicator-radius = 80;
};
};
home.packages = with pkgs; [
(pkgs.writeScriptBin "swaysleep" ''
swaylock & ${pkgs.swayidle}/bin/swayidle -w \
timeout 1 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"; pkill -9 swayidle'
'')
];
# Enable Swaylock on startup
wayland.windowManager.sway.config.startup = [
{ command = "swaylock"; }
];
}