meta: Move hyprlock / hypridle to separate modules

Makes it possible to use the hyprland module without using hypridle and
hyprlock.
This commit is contained in:
Donovan Glover 2024-09-03 16:10:02 -04:00
parent 85e5da19f2
commit f26cbc1aec
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
3 changed files with 73 additions and 71 deletions

34
home/hypridle.nix Normal file
View File

@ -0,0 +1,34 @@
{
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 150;
on-timeout = "brightnessctl set 0 --save && brightnessctl --device=tpacpi::kbd_backlight set 0 --save";
on-resume = "brightnessctl --restore && brightnessctl --device=tpacpi::kbd_backlight --restore";
}
{
timeout = 300;
on-timeout = "loginctl lock-session";
}
{
timeout = 380;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
}

View File

@ -334,78 +334,7 @@ in
}; };
}; };
programs.hyprlock = {
enable = true;
settings = {
general = {
hide_cursor = true;
grace = 2;
};
background = {
color = "rgba(25, 20, 20, 1.0)";
path = "screenshot";
blur_passes = 2;
brightness = 0.5;
};
label = {
text = "";
color = "rgba(222, 222, 222, 1.0)";
font_size = 50;
font_family = "Noto Sans CJK JP";
position = "0, 70";
halign = "center";
valign = "center";
};
input-field = {
size = "50, 50";
dots_size = 0.33;
dots_spacing = 0.15;
outer_color = "rgba(25, 20, 20, 0)";
inner_color = "rgba(25, 20, 20, 0)";
font_color = "rgba(222, 222, 222, 1.0)";
placeholder_text = "";
};
};
};
services = { services = {
hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 150;
on-timeout = "brightnessctl set 0 --save && brightnessctl --device=tpacpi::kbd_backlight set 0 --save";
on-resume = "brightnessctl --restore && brightnessctl --device=tpacpi::kbd_backlight --restore";
}
{
timeout = 300;
on-timeout = "loginctl lock-session";
}
{
timeout = 380;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
batsignal.enable = true; batsignal.enable = true;
swaync.enable = true; swaync.enable = true;
swayosd.enable = true; swayosd.enable = true;

39
home/hyprlock.nix Normal file
View File

@ -0,0 +1,39 @@
{
programs.hyprlock = {
enable = true;
settings = {
general = {
hide_cursor = true;
grace = 2;
};
background = {
color = "rgba(25, 20, 20, 1.0)";
path = "screenshot";
blur_passes = 2;
brightness = 0.5;
};
label = {
text = "";
color = "rgba(222, 222, 222, 1.0)";
font_size = 50;
font_family = "Noto Sans CJK JP";
position = "0, 70";
halign = "center";
valign = "center";
};
input-field = {
size = "50, 50";
dots_size = 0.33;
dots_spacing = 0.15;
outer_color = "rgba(25, 20, 20, 0)";
inner_color = "rgba(25, 20, 20, 0)";
font_color = "rgba(222, 222, 222, 1.0)";
placeholder_text = "";
};
};
};
}