{ config, pkgs, lib, ... }: let wallpaperStateFile = "${config.home.homeDirectory}/.config/home-manager/wallpaper-state.nix"; activeWallpaper = if builtins.pathExists wallpaperStateFile then lib.removeSuffix "\n" (builtins.readFile wallpaperStateFile) else ""; hyprlandStateFile = "${config.home.homeDirectory}/.config/home-manager/hyprland-state.json"; hyprlandState = if builtins.pathExists hyprlandStateFile then builtins.fromJSON (builtins.readFile hyprlandStateFile) else { gaps_out = 10; gaps_in = 5; border_size = 2; }; in { wayland.windowManager.hyprland = { enable = true; settings = { "general" = { "gaps_in" = hyprlandState.gaps_in; "gaps_out" = hyprlandState.gaps_out; "border_size" = hyprlandState.border_size; "col.active_border" = "rgb(${config.colorScheme.palette.base0E})"; "col.inactive_border" = "rgb(${config.colorScheme.palette.base03})"; }; "exec-once" = [ "swww-daemon & sleep 0.5 && swww img ${activeWallpaper} --transition-type none" "waybar" "nomarchy-on-boot" "nomarchy-welcome" ]; "bind" = [ "SUPER, Space, exec, walker" "SUPER ALT, Space, exec, nomarchy-theme-selector" "SUPER CTRL, Space, exec, nomarchy-font-selector" "SUPER SHIFT, Space, exec, nomarchy-wallpaper-selector" "SUPER, Return, exec, alacritty" "SUPER, Q, killactive," "SUPER, M, exit," ]; }; }; }