diff --git a/hosts/neodymium/home/wayland/default.nix b/hosts/neodymium/home/wayland/default.nix index d2f5dd5..e40ab25 100644 --- a/hosts/neodymium/home/wayland/default.nix +++ b/hosts/neodymium/home/wayland/default.nix @@ -8,11 +8,7 @@ let }; in { - programs.eww = { - enable = true; - package = pkgs.eww-wayland; - configDir = ./eww; - }; + imports = [ ./hyprland ./eww ]; services.mako = { enable = true; @@ -20,10 +16,61 @@ in { extraConfig = builtins.readFile "${catppuccin-mako}/src/mocha"; }; - wayland.windowManager.hyprland = { + services.swayidle = { enable = true; - recommendedEnvironment = true; - extraConfig = builtins.readFile ./hyprland.conf; + systemdTarget = "hyprland-session.target"; + events = [ + { + event = "after-resume"; + command = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; + } + { + event = "before-sleep"; + command = "${pkgs.swaylock-effects}/bin/swaylock -f"; + } + ]; + timeouts = [ + { + timeout = 120; + command = "${pkgs.swaylock-effects}/bin/swaylock -f --grace 3"; + } + { + timeout = 150; + command = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off"; + } + { + timeout = 300; + command = "${pkgs.systemd}/bin/systemctl suspend"; + } + ]; + }; + + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + image = "/home/laurent/Pictures/wallpapers/kai-oberhauser-unsplash.jpg"; + + clock = true; + timestr = "%T"; + datestr = "%F"; + + indicator = true; + indicator-radius = 100; + indicator-thickness = 7; + + effect-blur = "7x5"; + effect-vignette = "0.5:0.5"; + + ring-color = "bb00cc"; + key-hl-color = "880033"; + + line-color = "00000000"; + inside-color = "00000088"; + separator-color = "00000000"; + + text-color = "fffffff"; + }; }; } diff --git a/hosts/neodymium/home/wayland/eww/default.nix b/hosts/neodymium/home/wayland/eww/default.nix new file mode 100644 index 0000000..4f6a507 --- /dev/null +++ b/hosts/neodymium/home/wayland/eww/default.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + programs.eww = { + enable = true; + package = pkgs.eww-wayland; + configDir = ./.; + }; +} diff --git a/hosts/neodymium/home/wayland/hyprland/default.nix b/hosts/neodymium/home/wayland/hyprland/default.nix new file mode 100644 index 0000000..4499998 --- /dev/null +++ b/hosts/neodymium/home/wayland/hyprland/default.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + wayland.windowManager.hyprland = { + enable = true; + recommendedEnvironment = true; + + extraConfig = '' + exec-once=env XDG_CACHE_HOME=/tmp eww open bar + exec-once=${pkgs.swaybg}/bin/swaybg -i ~/Pictures/wallpapers/kai-oberhauser-unsplash.jpg + exec-once=mako + exec-once=element-desktop + exec-once=thunderbird + exec-once=webcord + exec-once=gnome-keyring-daemon --start --components=secrets + '' + builtins.readFile ./hyprland.conf; + }; +} diff --git a/hosts/neodymium/home/wayland/hyprland.conf b/hosts/neodymium/home/wayland/hyprland/hyprland.conf similarity index 90% rename from hosts/neodymium/home/wayland/hyprland.conf rename to hosts/neodymium/home/wayland/hyprland/hyprland.conf index 4d03695..97f8d06 100644 --- a/hosts/neodymium/home/wayland/hyprland.conf +++ b/hosts/neodymium/home/wayland/hyprland/hyprland.conf @@ -5,7 +5,14 @@ monitor=eDP-1,1920x1080@120,0x0,1 # Execute your favorite apps at launch -exec-once = env XDG_CACHE_HOME=/tmp eww open bar & swaybg -i ~/Pictures/wallpapers/kai-oberhauser-unsplash.jpg & mako & element-desktop & thunderbird & webcord & swayidle -w timeout 100 'swaylock -f --grace 3' timeout 130 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' timeout 300 'systemctl suspend' before-sleep 'swaylock -f' & gnome-keyring-daemon --start --components=secrets +# exec-once = env XDG_CACHE_HOME=/tmp eww open bar & \ +# swaybg -i ~/Pictures/wallpapers/kai-oberhauser-unsplash.jpg & \ +# swayidle -w & \ +# mako & \ +# element-desktop & \ +# thunderbird & \ +# webcord & \ +# gnome-keyring-daemon --start --components=secrets # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf @@ -82,8 +89,13 @@ gestures { } misc { + # no thanks disable_hyprland_logo = true disable_splash_rendering = true + + # turn on screen when mouse moves or key is pressed + mouse_move_enables_dpms = true + key_press_enables_dpms = true } # https://wiki.hyprland.org/Configuring/Window-Rules/