hyprland: fix hypridle/hyprlock

This commit is contained in:
ooks-io 2024-10-29 16:41:59 +11:00
parent efec6ac95c
commit 7be8e612c3
2 changed files with 47 additions and 55 deletions

View file

@ -1,13 +1,16 @@
{
inputs',
pkgs,
osConfig,
lib,
config,
...
}: let
inherit (lib) getExe mkIf;
inherit (lib) getExe getExe' mkIf;
inherit (osConfig.ooknet.workstation) environment;
dpms = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms";
lock = "${getExe' pkgs.systemd "loginctl"} lock-session";
hyprlock = getExe config.programs.hyprlock.package;
in {
config = mkIf (environment == "hyprland") {
@ -17,13 +20,18 @@ in {
settings = {
general = {
lock_cmd = hyprlock;
ignore_dbus_inhibit = false;
before_sleep_cmd = lock;
};
listener = [
{
timout = 300;
timeout = 300;
on-timeout = hyprlock;
}
{
timeout = 360;
on-timeout = "${dpms} off";
on-resume = "${dpms} on";
}
];
};
};

View file

@ -10,69 +10,53 @@
inherit (lib) mkIf;
in {
config = mkIf (environment == "hyprland") {
ooknet.binds.lock = "hyprlock";
ooknet.binds.lock = "loginctl lock-session";
programs.hyprlock = {
enable = true;
package = inputs'.hyprlock.packages.hyprlock;
package = inputs'.hyprlock.packages.default;
settings = {
enable = true;
general = {
disable_loading_bar = true;
hide_cursor = true;
no_fade_in = true;
no_fade_out = true;
};
background = {
monitor = "";
path = "";
color = "0xff${palette.base01}";
};
input-field = {
size = "200, 30";
position = "0, 0";
outline_thickness = 2;
dots_spacing = 0.3;
dots_rounding = 0;
rounding = 0;
fade_on_empty = false;
placeholder_text = "";
outer_color = "0xff${palette.base03}";
inner_color = "0xff${palette.base00}";
font_color = "0xff${palette.base05}";
};
label = {
monitor = "";
text = " LOCKED";
position = "0, 150";
valign = "center";
halign = "center";
color = "0xff${palette.base08}";
font_size = 30;
font_family = "${fonts.monospace.family}";
};
backgrounds = [
{
monitor = "";
path = "";
color = "0xff${palette.base01}";
}
];
input-fields = [
{
size = {
width = 300;
height = 40;
};
position = {
x = 0;
y = 0;
};
outline_thickness = 2;
dots_spacing = 0.2;
fade_on_empty = false;
placeholder_text = "";
outer_color = "0xff${palette.base02}";
inner_color = "0xff${palette.base00}";
font_color = "0xff${palette.base05}";
}
];
labels = [
{
monitor = "";
text = " ";
position = {
x = 0;
y = 80;
};
color = "0xff${palette.base08}";
font_size = 30;
font_family = "${fonts.monospace.family}";
}
{
monitor = "";
text = "$TIME";
position = {
x = 0;
y = -80;
};
color = "0xff${palette.base0B}";
font_size = 20;
font_family = "${fonts.monospace.family}";
}
];
};
};
};