wayland: add hypridle & hyprlock

This commit is contained in:
notohh 2024-03-07 03:54:42 -05:00
parent 2c6d6a8921
commit 864c1afe32
Signed by: notohh
GPG key ID: BD47506D475EE86D
5 changed files with 96 additions and 4 deletions

View file

@ -14,7 +14,7 @@
'';
};
in {
imports = [./greetd.nix];
imports = [./services/greetd.nix];
environment = {
systemPackages = with pkgs; [
dbus-hyprland-environment
@ -25,8 +25,6 @@ in {
satty
wl-clipboard
wlr-randr
swayidle
swaylock-effects
hyprpicker
swww
];
@ -60,7 +58,7 @@ in {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland
inputs.xdg-portal-hyprland.packages.${pkgs.system}.default
];
config = {
common.default = "*";

View file

@ -0,0 +1,70 @@
_: {
programs.hyprlock = {
enable = true;
backgrounds = let
wallpaperPath = "/home/notoh/Pictures/wallpapers/cweam.png";
in [
{
monitor = "DP-1";
path = wallpaperPath;
}
{
monitor = "DP-2";
path = wallpaperPath;
}
{
monitor = "DP-3";
path = wallpaperPath;
}
{
monitor = "HDMI-A-1";
path = wallpaperPath;
}
];
general = {
disable_loading_bar = false;
hide_cursor = false;
no_fade_in = false;
};
input-fields = [
{
monitor = "DP-2";
size = {
width = 300;
height = 50;
};
outline_thickness = 2;
outer_color = "rgb(1e1e2e)";
inner_color = "rgb(1e1e2e)";
font_color = "rgb(cdd6f4)";
placeholder_text = ''
<span foreground="##cdd6f4">Password...</span>
'';
fade_on_empty = false;
dots_spacing = 0.3;
dots_center = true;
}
];
labels = [
{
monitor = "DP-2";
text = "Hi, $USER";
color = "rgb(1e1e2e)";
valign = "center";
halign = "center";
}
{
monitor = "DP-2";
text = "$TIME";
color = "rgb(1e1e2e)";
position = {
x = 0;
y = 120;
};
valign = "center";
halign = "center";
}
];
};
}

View file

@ -0,0 +1,24 @@
{
pkgs,
config,
lib,
...
}: {
services.hypridle = {
enable = true;
ignoreDbusInhibit = false;
lockCmd = lib.getExe config.programs.hyprlock.package;
beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session";
listeners = [
{
timeout = 500;
onTimeout = "${lib.getExe config.programs.hyprlock.package}";
}
{
timeout = 560;
onTimeout = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off";
onResume = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on";
}
];
};
}