{ pkgs, config, inputs, lib, ... }: let terminal = "${config.programs.kitty.package}/bin/kitty -1"; in { imports = [ ./waybar.nix ]; home.packages = with pkgs; [ hyprland-workspaces inputs.gnome-autounlock-keyring.packages.${pkgs.system}.default inputs.hyprland-qtutils.packages.${pkgs.system}.default ]; programs = { rofi = { enable = true; package = pkgs.rofi-wayland; theme = { listview.columns = 1; }; }; hyprlock = { enable = true; settings = let color = "rgba(242, 243, 244, 0.75)"; in { auth.fingerprint.enabled = true; background = { path = "screenshot"; blur_passes = 3; }; }; }; # eww = { # enable = true; # configDir = ./eww; # }; }; services = { gnome-keyring.enable = true; mako = { enable = true; settings.defaultTimeout = 5000; }; 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.5 mins on-timeout = "${pkgs.brightnessctl}/bin/brightnessctl -s set 10"; on-resume = "${pkgs.brightnessctl}/bin/brightnessctl -r"; } { timeout = 150; # 2.5 mins on-timeout = "${pkgs.brightnessctl}/bin/brightnessctl -sd tpacpi:kbd_backlight set 0"; on-resume = "${pkgs.brightnessctl}/bin/brightnessctl -rd tpacpi::kbd_backlight"; } { timeout = 300; # 5 mins on-timeout = "loginctl lock-session"; } { timeout = 600; # 10 mins, screen off on-timeout = "hyprctl dispatch dpms off"; on-resume = "hyprctl dispatch dpms on"; } { timeout = 1800; # 30 mins on-timeout = "systemctl suspend"; } ]; }; }; hyprpaper = let wallpaper = ../../../../assets/wallpaper-nix-pink.png; in { enable = true; settings = { preload = [ "${wallpaper}" ]; wallpaper = [ "eDP-1,${wallpaper}" ]; splash = false; ipc = "off"; }; }; }; # Hack to ensure graphical dependent services start _after_ hyprland starts # Needed as these services normally start after graphical-session-pre systemd.user.services.hyprpaper.Unit.After = lib.mkForce "graphical-session.target"; systemd.user.services.waybar.Unit.After = lib.mkForce "graphical-session.target"; systemd.user.services.hypridle.Unit.After = lib.mkForce "graphical-session.target"; wayland.windowManager.hyprland = let toggle_mirror = pkgs.writeScriptBin "toggle_mirror.sh" '' #!${pkgs.stdenv.shell} if [ $(hyprctl monitors all -j | ${pkgs.jq}/bin/jq '.[1].activeWorkspace.id') = '-1' ]; then hyprctl keyword monitor ",preferred,auto,1" else hyprctl keyword monitor ",preferred,auto,1,mirror,eDP-1" fi ''; # Autostart now handled by xdg.autoStart startup = pkgs.writeScriptBin "startup.sh" '' #!${pkgs.stdenv.shell} # uwsm app -- ${pkgs.wl-clip-persist}/bin/wl-clip-persist -c both & ''; in { enable = true; systemd.enable = false; # using UWSM plugins = with pkgs.hyprlandPlugins; [ hyprexpo ]; settings = let inherit (builtins) genList concatLists toString; wpctl = "${pkgs.wireplumber}/bin/wpctl"; brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; menu = "${config.programs.rofi.package}/bin/rofi -columns 1 -show combi -modes combi -combi-modes \"window,drun,run\""; fileManager = "${pkgs.nautilus}/bin/nautilus"; in { "$mod" = "SUPER"; exec-once = [ "${startup}/bin/startup.sh" ]; monitor = [ "eDP-1, 3840x2400@60,0x0,2" ",highres,auto,1" ]; input = { touchpad.natural_scroll = true; }; general = { gaps_in = 5; gaps_out = 10; border_size = 2; "col.active_border" = "rgba(babbf1ee) rgba(f4b8e4ee) 45deg"; "col.inactive_border" = "rgba(303446aa)"; layout = "dwindle"; # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = true; }; group = { "col.border_active" = "rgba(babbf1ee) rgba(f4b8e4ee) 45deg"; "col.border_inactive" = "rgba(232634aa)"; groupbar = { font_size = 10; height = 18; "col.active" = "rgba(babbf1aa)"; "col.inactive" = "rgba(414559aa)"; text_color = "rgba(ffffffee)"; }; }; plugin.hyprexpo = { workspace_method = "first 1"; enable_gesture = true; gesture_positive = false; gesture_fingers = 3; }; decoration = { rounding = 10; blur = { enabled = true; size = 3; passes = 1; }; shadow = { enabled = true; color = "rgba(1a1a1aee)"; range = 4; render_power = 3; }; }; animations = { enabled = "yes"; bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; animation = [ "windows, 1, 7, myBezier" "windowsOut, 1, 7, default, popin 80%" "border, 1, 10, default" "borderangle, 1, 8, default" "fade, 1, 4, default" "workspaces, 1, 4, default" ]; }; dwindle = { preserve_split = "yes"; pseudotile = "yes"; }; gestures.workspace_swipe = true; misc = { force_default_wallpaper = 2; disable_splash_rendering = true; disable_hyprland_logo = true; disable_autoreload = true; }; windowrulev2 = [ "suppressevent maximize, class:.*" "workspace 1 silent, class:^(Element)$" "workspace 1 silent, class:^(discord)$" "group, class:^(Element|discord)$,workspace:1" "workspace 2 silent, class:^(firefox)$" "float,class:^(firefox)$,title:^(Picture-in-Picture)$" "workspace special:obsidian silent, class:^(obsidian)$" ]; # l -> works when screen is locked # e -> repeats when held bindel = [ ",XF86AudioRaiseVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%+" ",XF86AudioLowerVolume,exec,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-" ",XF86MonBrightnessUp,exec,${brightnessctl} -q s +5%" ",XF86MonBrightnessDown,exec,${brightnessctl} -q s 5%-" ]; bindl = [ ",XF86AudioMute, exec,${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" ]; bind = [ "$mod, RETURN, exec, uwsm app -- ${terminal}" "$mod, Q, killactive," "$mod SHIFT, Q, exec, uwsm stop," "$mod, E, exec, uwsm app -- ${fileManager}" "$mod, V, togglefloating," "$mod, D, exec, uwsm app -- ${menu}" "$mod, P, pseudo, # dwindle" "$mod, J, togglesplit, # dwindle" "$mod,m,fullscreen" "$mod, L, exec, loginctl lock-session" "$mod, space, hyprexpo:expo, toggle" # Move focus with arrow keys "$mod, left, movefocus, l" "$mod, right, movefocus, r" "$mod, up, movefocus, u" "$mod, down, movefocus, d" # Scratch workspace "$mod, S, togglespecialworkspace, scratch" "$mod SHIFT, S, movetoworkspace, special:scratch" # Obsidian Workspace "$mod, O, togglespecialworkspace, obsidian" "$mod SHIFT, O, movetoworkspace, special:obsidian" # Groups aka Tabs "$mod,g,togglegroup" "$mod,tab,changegroupactive" # PrintScreen ",Print,exec,uwsm app -- ${pkgs.grimblast}/bin/grimblast copysave area /home/vivian/cloud/Pictures/Screenshots/$(date +%s).png" # Toggle Mirror for external displays on/off ",XF86Display,exec,${toggle_mirror}/bin/toggle_mirror.sh" ] ++ ( # workspaces # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} concatLists ( genList ( x: let ws = let c = (x + 1) / 10; in toString (x + 1 - (c * 10)); in [ "$mod, ${ws}, workspace, ${toString (x + 1)}" "$mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)}" ] ) 10 ) ); # Bind mouse bindm = [ # Move/resize windows with mod + LMB/RMB and dragging "$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow" ]; }; }; }