feat(desktop): Hyprland, Waybar, autostart/bindings/idle
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
b16707b2ab
commit
6e87d8e186
5 changed files with 1317 additions and 0 deletions
179
modules/desktop/hyprland/idle.nix
Normal file
179
modules/desktop/hyprland/idle.nix
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf optionals;
|
||||
cfg = config.omni.desktop;
|
||||
user = config.omni.user;
|
||||
in
|
||||
{
|
||||
config = mkIf (cfg.enable) {
|
||||
home-manager.users.${user} = {
|
||||
# Hypridle — screen dimming, locking, DPMS, optional suspend
|
||||
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 = [
|
||||
# Dim screen after 5 minutes
|
||||
{
|
||||
timeout = 300;
|
||||
on-timeout = "brightnessctl -s set 10%";
|
||||
on-resume = "brightnessctl -r";
|
||||
}
|
||||
# Lock screen after 10 minutes
|
||||
{
|
||||
timeout = 600;
|
||||
on-timeout = "loginctl lock-session";
|
||||
}
|
||||
# Turn off screen after 15 minutes
|
||||
{
|
||||
timeout = 900;
|
||||
on-timeout = "hyprctl dispatch dpms off";
|
||||
on-resume = "hyprctl dispatch dpms on";
|
||||
}
|
||||
]
|
||||
++ optionals cfg.idleSuspend [
|
||||
# Suspend after 30 minutes
|
||||
{
|
||||
timeout = 1800;
|
||||
on-timeout = "systemctl suspend";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Hyprlock — lock screen appearance
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
disable_loading_bar = true;
|
||||
grace = 5;
|
||||
hide_cursor = false;
|
||||
no_fade_in = false;
|
||||
};
|
||||
|
||||
background = [
|
||||
{
|
||||
monitor = "";
|
||||
path = if cfg.wallpaper != null then toString cfg.wallpaper else "~/Pictures/wallpaper.jpg";
|
||||
blur_passes = 3;
|
||||
blur_size = 8;
|
||||
noise = 0.0117;
|
||||
contrast = 0.8916;
|
||||
brightness = 0.8172;
|
||||
vibrancy = 0.1696;
|
||||
vibrancy_darkness = 0.0;
|
||||
}
|
||||
];
|
||||
|
||||
image = [
|
||||
{
|
||||
monitor = "";
|
||||
path = "~/.face";
|
||||
size = 150;
|
||||
rounding = -1;
|
||||
border_size = 4;
|
||||
border_color = "rgb(221, 221, 221)";
|
||||
position = "0, 200";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
];
|
||||
|
||||
label = [
|
||||
# Time
|
||||
{
|
||||
monitor = "";
|
||||
text = ''cmd[update:30000] echo "$TIME"'';
|
||||
color = "rgba(200, 200, 200, 1.0)";
|
||||
font_size = 55;
|
||||
font_family = "JetBrainsMono Nerd Font";
|
||||
position = "-100, -40";
|
||||
halign = "right";
|
||||
valign = "bottom";
|
||||
shadow_passes = 5;
|
||||
shadow_size = 10;
|
||||
}
|
||||
# Date
|
||||
{
|
||||
monitor = "";
|
||||
text = ''cmd[update:43200000] echo "$(date +"%A, %d %B %Y")"'';
|
||||
color = "rgba(200, 200, 200, 1.0)";
|
||||
font_size = 25;
|
||||
font_family = "JetBrainsMono Nerd Font";
|
||||
position = "-100, -150";
|
||||
halign = "right";
|
||||
valign = "bottom";
|
||||
shadow_passes = 5;
|
||||
shadow_size = 10;
|
||||
}
|
||||
# Username
|
||||
{
|
||||
monitor = "";
|
||||
text = user;
|
||||
color = "rgba(200, 200, 200, 1.0)";
|
||||
font_size = 20;
|
||||
font_family = "JetBrainsMono Nerd Font";
|
||||
position = "0, 80";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
shadow_passes = 5;
|
||||
shadow_size = 10;
|
||||
}
|
||||
# Hostname
|
||||
{
|
||||
monitor = "";
|
||||
text = ''cmd[update:60000] echo "$(uname -n)"'';
|
||||
color = "rgba(200, 200, 200, 0.8)";
|
||||
font_size = 16;
|
||||
font_family = "JetBrainsMono Nerd Font";
|
||||
position = "100, 40";
|
||||
halign = "left";
|
||||
valign = "bottom";
|
||||
shadow_passes = 5;
|
||||
shadow_size = 10;
|
||||
}
|
||||
];
|
||||
|
||||
input-field = [
|
||||
{
|
||||
monitor = "";
|
||||
size = "200, 50";
|
||||
outline_thickness = 3;
|
||||
dots_size = 0.33;
|
||||
dots_spacing = 0.15;
|
||||
dots_center = false;
|
||||
dots_rounding = -1;
|
||||
outer_color = "rgb(151515)";
|
||||
inner_color = "rgb(200, 200, 200)";
|
||||
font_color = "rgb(10, 10, 10)";
|
||||
fade_on_empty = true;
|
||||
fade_timeout = 1000;
|
||||
placeholder_text = "<i>Input Password...</i>";
|
||||
hide_input = false;
|
||||
rounding = -1;
|
||||
check_color = "rgb(204, 136, 34)";
|
||||
fail_color = "rgb(204, 34, 34)";
|
||||
fail_text = "<i>$FAIL <b>($ATTEMPTS)</b></i>";
|
||||
fail_timeout = 2000;
|
||||
position = "0, -20";
|
||||
halign = "center";
|
||||
valign = "center";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue