zenix: add hypridle and hyprlock, and format

This commit is contained in:
tristan 2024-07-30 02:23:39 +01:00
parent c4abd3ddf0
commit ce02fb7bee
11 changed files with 86 additions and 17 deletions

View file

@ -6,10 +6,17 @@
}: let
modifier = config.windowManager.modifierKey;
menu = config.programs.menu.dmenuCommand;
lock_cmd = "${config.programs.hyprlock.package}/bin/hyprlock";
color = {
inherit (config.lib.stylix.colors) yellow red;
bg = config.lib.stylix.colors.base00;
fg = config.lib.stylix.colors.base07;
text = config.lib.stylix.colors.base05;
};
rgb = color: "rgb(${color})";
in {
imports = [
(import ../utils/swaylock.nix)
(import ../utils/swayidle.nix)
(import ../utils/waybar.nix)
(import ../utils/display.nix)
];
@ -19,6 +26,64 @@ in {
extraPortals = [pkgs.xdg-desktop-portal-gtk];
};
services.hypridle = {
enable = true;
settings = {
general = {
before_sleep_cmd = "rbw lock";
after_sleep_cmd = "hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "pidof ${lock_cmd} || ${lock_cmd}";
};
listener = [
{
timeout = 300;
on-timeout = "loginctl lock-session";
}
{
timeout = 1200;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
programs.hyprlock = {
enable = true;
settings = {
# https://wiki.hyprland.org/Hypr-Ecosystem/hyprlock/
general = {
disable_loading_bar = true;
hide_cursor = true;
no_fade_in = false;
};
background = [
{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}
];
input-field = [
{
dots_center = true;
fade_on_empty = true;
outline_thickness = 5;
shadow_passes = 2;
inner_color = rgb color.bg;
outer_color = rgb color.fg;
font_color = rgb color.text;
fail_color = rgb color.red;
check_color = rgb color.yellow;
}
];
};
};
wayland.windowManager.hyprland = {
enable = true;
systemd = {
@ -26,7 +91,6 @@ in {
variables = ["--all"];
};
settings = {
exec-once = ["${pkgs.swaybg}/bin/swaybg -i ${config.stylix.image} -m fill"];
input = {
touchpad = {
natural_scroll = true;

View file

@ -15,7 +15,7 @@
timeouts = [
{
timeout = 300;
command = "${pkgs.swaylock-effects}/bin/swaylock -f";
command = "loginctl lock-session";
}
{
timeout = 600;