mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-21 07:44:13 +01:00
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:
parent
85e5da19f2
commit
f26cbc1aec
34
home/hypridle.nix
Normal file
34
home/hypridle.nix
Normal 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";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -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 = {
|
||||
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;
|
||||
swaync.enable = true;
|
||||
swayosd.enable = true;
|
||||
|
39
home/hyprlock.nix
Normal file
39
home/hyprlock.nix
Normal 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 = "パスワード";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user