diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index bf48a4a..ae278fc 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -1,5 +1,11 @@ { pkgs, ... }: { + imports = [ + ./gtk.nix + ./hypridle.nix + ./hyprlock.nix + ]; + home.pointerCursor = { gtk.enable = true; # x11.enable = true; @@ -12,26 +18,6 @@ enable = true; }; - gtk = { - enable = true; - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - - theme = { - package = pkgs.whitesur-gtk-theme; - name = "Whitesur-dark"; - }; - - iconTheme = { - package = pkgs.whitesur-icon-theme; - name = "Whitesur-Dark"; - }; - }; - xdg.configFile = { hypr = { source = ../../hypr; diff --git a/home-manager/hyprland/gtk.nix b/home-manager/hyprland/gtk.nix new file mode 100644 index 0000000..a8734bf --- /dev/null +++ b/home-manager/hyprland/gtk.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + gtk = { + enable = true; + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + + theme = { + package = pkgs.whitesur-gtk-theme; + name = "Whitesur-dark"; + }; + + iconTheme = { + package = pkgs.whitesur-icon-theme; + name = "Whitesur-Dark"; + }; + }; +} diff --git a/home-manager/hyprland/hypridle.nix b/home-manager/hyprland/hypridle.nix new file mode 100644 index 0000000..d2c73b2 --- /dev/null +++ b/home-manager/hyprland/hypridle.nix @@ -0,0 +1,39 @@ +{ ... }: +{ + 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 = [ + { + timeout = 150; # 2.5min. + on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. + on-resume = "brightnessctl -r"; # monitor backlight restore. + } + # turn off keyboard backlight, comment out this section if you dont have a keyboard backlight. + { + timeout = 150; # 2.5min. + on-timeout = "brightnessctl -sd rgb:kbd_backlight set 0"; # turn off keyboard backlight. + on-resume = "brightnessctl -rd rgb:kbd_backlight"; # turn on keyboard backlight. + } + { + timeout = 300; # 5min + on-timeout = "loginctl lock-session"; # lock screen when timeout has passed + } + { + timeout = 330; # 5.5min + on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. + } + { + timeout = 1800; # 30min + on-timeout = "systemctl suspend"; # suspend pc + } + ]; + }; + }; +} diff --git a/home-manager/hyprland/hyprlock.nix b/home-manager/hyprland/hyprlock.nix new file mode 100644 index 0000000..9bedb4c --- /dev/null +++ b/home-manager/hyprland/hyprlock.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + programs.hyprlock = { + enable = true; + settings = { + background = { + blur_passes = 4; + blur_size = 2; + noise = 1.17e-2; + contrast = 0.8916; + brightness = 0.8172; + vibrancy = 0.1696; + vibrancy_darkness = 0.0; + }; + }; + }; +} diff --git a/hypr/hypridle.conf b/hypr/hypridle.conf deleted file mode 100644 index c82f4f9..0000000 --- a/hypr/hypridle.conf +++ /dev/null @@ -1,35 +0,0 @@ -general { - lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. - before_sleep_cmd = loginctl lock-session # lock before suspend. - after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. -} - -listener { - timeout = 150 # 2.5min. - on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. - on-resume = brightnessctl -r # monitor backlight restore. -} - -# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight. -listener { - timeout = 150 # 2.5min. - on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight. - on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight. -} - -listener { - timeout = 300 # 5min - on-timeout = loginctl lock-session # lock screen when timeout has passed -} - -listener { - timeout = 330 # 5.5min - on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed - on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. -} - -listener { - timeout = 1800 # 30min - on-timeout = systemctl suspend # suspend pc -} - diff --git a/hypr/hyprlock.conf b/hypr/hyprlock.conf deleted file mode 100644 index 41b7ad8..0000000 --- a/hypr/hyprlock.conf +++ /dev/null @@ -1,52 +0,0 @@ -# _ _ _ -# | |__ _ _ _ __ _ __| | ___ ___| | __ -# | '_ \| | | | '_ \| '__| |/ _ \ / __| |/ / -# | | | | |_| | |_) | | | | (_) | (__| < -# |_| |_|\__, | .__/|_| |_|\___/ \___|_|\_\ -# |___/|_| -# - -background { - monitor = - #path = $HOME/dotfiles/.settings/lockscreen.png # only png supported for now - color = rgba(25, 20, 20, 1.0) - - # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations - blur_passes = 4 # 0 disables blurring - blur_size = 2 - noise = 0.0117 - contrast = 0.8916 - brightness = 0.8172 - vibrancy = 0.1696 - vibrancy_darkness = 0.0 -} - -input-field { - monitor = - size = 200, 50 - outline_thickness = 1 - dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 - dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0 - dots_center = true - outer_color = rgb(000000) - inner_color = rgb(200, 200, 200) - font_color = rgb(10, 10, 10) - fade_on_empty = true - placeholder_text = Input Password... # Text rendered in the input box when it's empty. - hide_input = false - position = 0, -20 - halign = center - valign = center -} - -label { - monitor = - text = Enter your password to unlock - color = rgba(200, 200, 200, 1.0) - font_size = 25 - font_family = Noto Sans - - position = 0, 200 - halign = center - valign = center -}