Added Hypridle and Hyprlock && switched to UWSM
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./hypridle.nix
|
||||
./hyprland.nix
|
||||
./hyprlock.nix
|
||||
./keybinds.nix
|
||||
./monitors.nix
|
||||
];
|
||||
|
||||
29
modules/home/hypr/hypridle.nix
Normal file
29
modules/home/hypr/hypridle.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "pidof hyprlock || hyprlock";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
};
|
||||
listener = [
|
||||
{
|
||||
timeout = 300;
|
||||
on-timeout = "loginctl lock-session";
|
||||
}
|
||||
{
|
||||
timeout = 600;
|
||||
on-timeout = "hyprctl dispatch dpms off";
|
||||
on-resume = "hyprctl dispatch dpms on";
|
||||
}
|
||||
{
|
||||
timeout = 1800;
|
||||
on-timeout = "systemctl suspend || loginctl suspend";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
# inputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
@@ -8,8 +9,12 @@
|
||||
hyprpolkitagent
|
||||
];
|
||||
|
||||
xdg.configFile."uwsm/env".source =
|
||||
"${config.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh";
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
systemd.enable = false;
|
||||
package = null;
|
||||
portalPackage = null;
|
||||
|
||||
@@ -48,14 +53,18 @@
|
||||
];
|
||||
|
||||
exec-once = [
|
||||
"systemctl --user enable --now hypridle.service"
|
||||
"systemctl --user enable --now hyprpolkitagent.service"
|
||||
"systemctl --user enable app-com.mitchellh.ghostty.service"
|
||||
"wpaperd -d"
|
||||
"systemctl enable --user app-com.mitchellh.ghostty.service"
|
||||
];
|
||||
|
||||
env = [
|
||||
"NIXOS_OZONE_WL, 1"
|
||||
"HYPRSHOT_DIR, ${config.xdg.userDirs.extraConfig.XDG_SCREENSHOTS_DIR}"
|
||||
"XDG_CURRENT_DESKTOP, Hyprland"
|
||||
"XDG_SESSION_TYPE, wayland"
|
||||
"XDG_SESSION_DESKTOP, Hyprland"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
110
modules/home/hypr/hyprlock.nix
Normal file
110
modules/home/hypr/hyprlock.nix
Normal file
@@ -0,0 +1,110 @@
|
||||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
primary-monitor = "eDP-1";
|
||||
|
||||
text-color = "rgba(${config.lib.stylix.colors.base0F}FF)";
|
||||
entry-background-color = "rgba(${config.lib.stylix.colors.base0F}11)";
|
||||
entry-border-color = "rgba(${config.lib.stylix.colors.base0F}55)";
|
||||
font-family = "Rubik Light";
|
||||
in
|
||||
{
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
hide_cursor = true;
|
||||
grace = 10;
|
||||
};
|
||||
background = [
|
||||
{
|
||||
path = "${config.xdg.userDirs.extraConfig.XDG_WALLPAPERS_DIR}/sunset_bay.jpg";
|
||||
blur_passes = 3;
|
||||
}
|
||||
];
|
||||
input-field = [
|
||||
{
|
||||
monitor = primary-monitor;
|
||||
size = "250, 50";
|
||||
outline_thickness = 2;
|
||||
dots_size = 0.1;
|
||||
dots_spacing = 0.3;
|
||||
outer_color = entry-border-color;
|
||||
inner_color = entry-background-color;
|
||||
font_color = text-color;
|
||||
fade_on_empty = true;
|
||||
|
||||
position = "0, 20";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
];
|
||||
label = [
|
||||
{
|
||||
# Caps Lock Warning
|
||||
monitor = primary-monitor;
|
||||
text = "cmd[update:250] check-capslock";
|
||||
color = text-color;
|
||||
font_size = 13;
|
||||
font_family = font-family;
|
||||
position = "0, -25";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
# Clock
|
||||
monitor = primary-monitor;
|
||||
text = "$TIME";
|
||||
color = text-color;
|
||||
font_size = 65;
|
||||
font_family = font-family;
|
||||
|
||||
position = "0, 300";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
# Date
|
||||
monitor = primary-monitor;
|
||||
text = "cmd[update:5000] date +\"%A, %B %d\"";
|
||||
color = text-color;
|
||||
font_size = 17;
|
||||
font_family = font-family;
|
||||
|
||||
position = "0, 240";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
{
|
||||
# User
|
||||
monitor = primary-monitor;
|
||||
text = " $USER";
|
||||
color = text-color;
|
||||
outline_thickness = 2;
|
||||
dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8
|
||||
dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0
|
||||
dots_center = true;
|
||||
font_size = 20;
|
||||
font_family = font-family;
|
||||
position = "0, 50";
|
||||
halign = "center";
|
||||
valign = "bottom";
|
||||
}
|
||||
{
|
||||
# Status
|
||||
monitor = primary-monitor;
|
||||
text = "cmd[update:5000] hyprlock-status";
|
||||
color = text-color;
|
||||
font_size = 14;
|
||||
font_family = font-family;
|
||||
|
||||
position = "30, -30";
|
||||
halign = "left";
|
||||
valign = "top";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user