sway output config/hypridle toggle

This commit is contained in:
janis 2025-09-03 04:32:38 +02:00
parent 6741c7bdf8
commit 1872e44454
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8
3 changed files with 54 additions and 34 deletions

View file

@ -1,44 +1,47 @@
{pkgs, ...}: { {pkgs, lib, super-config, ...}: {
services.hyprpolkitagent.enable = true; services.hyprpolkitagent.enable = true;
programs.hyprlock.enable = true; programs.hyprlock.enable = true;
# services.hypridle = { services.hypridle = lib.optionals (super-config.enableHypridle == true) {
# enable = true; enable = true;
# settings = let settings = let
# idle_timeout = "300"; # 5 minutes idle_timeout = "300"; # 5 minutes
# screen_timeout = "600"; # 10 minutes screen_timeout = "600"; # 10 minutes
# suspend_timeout = "900"; # 10 minutes suspend_timeout = "900"; # 10 minutes
# lock_cmd = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; lock_cmd = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
# suspend_cmd = "systemctl suspend"; suspend_cmd = "systemctl suspend";
# in{ in{
# general = { general = {
# inherit lock_cmd; inherit lock_cmd;
# before_sleep_cmd = "loginctl lock-session"; before_sleep_cmd = "loginctl lock-session";
# }; };
# listener = [ listener = [
# { {
# timeout = idle_timeout; timeout = idle_timeout;
# on-timeout = "loginctl lock-session"; on-timeout = "loginctl lock-session";
# } }
# { {
# timeout = screen_timeout; timeout = screen_timeout;
# on-timeout = "{pkgs.sway}/bin/swaymsg 'output * dpms off'"; on-timeout = "{pkgs.sway}/bin/swaymsg 'output * dpms off'";
# on-resume = "{pkgs.sway}/bin/swaymsg 'output * dpms on'"; on-resume = "{pkgs.sway}/bin/swaymsg 'output * dpms on'";
# } }
# { {
# timeout = suspend_timeout; timeout = suspend_timeout;
# on-timeout = suspend_cmd; on-timeout = suspend_cmd;
# } }
# ]; ];
# }; };
# }; };
home.packages = with pkgs; [ home.packages = with pkgs; [
hyprlock hyprlock
# hypridle ] ++ (lib.optionals (super-config.enableHypridle == true) [
]; hypridle
]);
xdg.configFile."hypr/hyprlock.conf" = { xdg.configFile."hypr/hyprlock.conf" = {
source = "${pkgs.dotfiles}/.config/hypr/hyprlock.conf"; source = "${pkgs.dotfiles}/.config/hypr/hyprlock.conf";

View file

@ -34,6 +34,11 @@ in {
config = { config = {
modifier = "${mod}"; modifier = "${mod}";
fonts = {
names = ["SF Compact Rounded"];
size = 10.0;
};
seat = { seat = {
"*" = { "*" = {
xcursor_theme = "\"WhiteSur-cursors\" 32"; xcursor_theme = "\"WhiteSur-cursors\" 32";
@ -42,7 +47,7 @@ in {
output = { output = {
"*".scale = "${lib.strings.floatToString super-config.desktop_scale}"; "*".scale = "${lib.strings.floatToString super-config.desktop_scale}";
}; }// super-config.extraOutputConfig;
startup = [ startup = [
{ {

View file

@ -18,10 +18,22 @@
description = "Enable dark mode for the system."; description = "Enable dark mode for the system.";
}; };
enableHypridle = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable hypridle for the system.";
};
desktop_scale = lib.mkOption { desktop_scale = lib.mkOption {
type = lib.types.float; type = lib.types.float;
default = 1.0; default = 1.0;
description = "HiDpi scale factor for the window manager"; description = "HiDpi scale factor for the window manager";
}; };
extraOutputConfig = lib.mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.anything);
default = {};
description = "Additional config for sway outputs";
};
}; };
} }