diff --git a/home/hypridle.nix b/home/hypridle.nix new file mode 100644 index 00000000..7e749cfe --- /dev/null +++ b/home/hypridle.nix @@ -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"; + } + ]; + }; + }; +} diff --git a/home/hyprland.nix b/home/hyprland.nix index 372c35a0..a366ed44 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -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; diff --git a/home/hyprlock.nix b/home/hyprlock.nix new file mode 100644 index 00000000..9fb38687 --- /dev/null +++ b/home/hyprlock.nix @@ -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 = "パスワード"; + }; + }; + }; +}