-
Notifications
You must be signed in to change notification settings - Fork 13
/
hyprlock.nix
85 lines (80 loc) · 1.85 KB
/
hyprlock.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
self,
lib,
pkgs,
hostname,
...
}:
let
theme = import "${self}/lib/theme" { inherit pkgs hostname; };
inherit (theme) hexToRgb colours;
in
{
programs.hyprlock = {
enable = true;
settings = {
general = {
grace = 5;
hide_cursor = true;
};
background = [
{
path = "${theme.wallpaper}";
blur_passes = 2;
blur_size = 6;
}
];
input-field = [
{
size = "250, 60";
outer_color = "rgb(${hexToRgb colours.black})";
inner_color = "rgb(${hexToRgb colours.bgDark})";
font_color = "rgb(${hexToRgb colours.purple})";
placeholder_text = "";
}
];
label = [
{
text = "Hello";
color = "rgba(${hexToRgb colours.text}, 1.0)";
font_family = theme.fonts.default.name;
font_size = 64;
text_align = "center";
halign = "center";
valign = "center";
position = "0, 160";
}
{
text = "$TIME";
color = "rgba(${hexToRgb colours.subtext1}, 1.0)";
font_family = theme.fonts.default.name;
font_size = 32;
text_align = "center";
halign = "center";
valign = "center";
position = "0, 75";
}
];
};
};
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "${lib.getExe pkgs.hyprlock}";
before_sleep_cmd = "${lib.getExe pkgs.hyprlock}";
};
listener = [
{
timeout = 300;
on-timeout = "${lib.getExe pkgs.hyprlock}";
}
{
timeout = 305;
on-timeout = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
on-resume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
}
];
};
};
}