diff --git a/flake.lock b/flake.lock index 7360fb2..5018b0c 100644 --- a/flake.lock +++ b/flake.lock @@ -92,6 +92,26 @@ "type": "github" } }, + "hy3": { + "inputs": { + "hyprland": [ + "hyprland" + ] + }, + "locked": { + "lastModified": 1738405375, + "narHash": "sha256-blIcXp9XfQbxUW14vKQn6KaBN3kBW13B1zz6SgwKZ5w=", + "owner": "outfoxxed", + "repo": "hy3", + "rev": "977a4d355d6553a3a1b27d725c52e1d133aad720", + "type": "github" + }, + "original": { + "owner": "outfoxxed", + "repo": "hy3", + "type": "github" + } + }, "hyprcursor": { "inputs": { "hyprlang": [ @@ -181,36 +201,6 @@ "type": "github" } }, - "hyprland-plugins": { - "inputs": { - "hyprland": [ - "hyprland" - ], - "nixpkgs": [ - "hyprland-plugins", - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland-plugins", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1737904125, - "narHash": "sha256-DkfsT1A0neDaWUY/TGHo1IVHLaUlifWNpqJ7Eebp1j4=", - "owner": "hyprwm", - "repo": "hyprland-plugins", - "rev": "bf3ec0479d57227a5f275eedcff04529e780c0c0", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-plugins", - "type": "github" - } - }, "hyprland-protocols": { "inputs": { "nixpkgs": [ @@ -434,6 +424,21 @@ "type": "github" } }, + "nix-filter": { + "locked": { + "lastModified": 1693833173, + "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1737885589, @@ -476,9 +481,31 @@ "root": { "inputs": { "home-manager": "home-manager", + "hy3": "hy3", "hyprland": "hyprland", - "hyprland-plugins": "hyprland-plugins", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "split-monitor-workspaces": "split-monitor-workspaces" + } + }, + "split-monitor-workspaces": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nix-filter": "nix-filter" + }, + "locked": { + "lastModified": 1738268546, + "narHash": "sha256-OIGdPTkR72iW5JfCmMfIpfFcum+ovIpesb5P3DJZAik=", + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "rev": "26d65cfe611bcaf30826a7ee7c660547ed4e84e3", + "type": "github" + }, + "original": { + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "type": "github" } }, "systems": { diff --git a/flake.nix b/flake.nix index c31725d..1dbc6a3 100644 --- a/flake.nix +++ b/flake.nix @@ -11,8 +11,12 @@ url = "github:hyprwm/Hyprland"; inputs.nixpkgs.follows = "nixpkgs"; }; - hyprland-plugins = { - url = "github:hyprwm/hyprland-plugins"; + hy3 = { + url = "github:outfoxxed/hy3"; + inputs.hyprland.follows = "hyprland"; + }; + split-monitor-workspaces = { + url = "github:Duckonaut/split-monitor-workspaces"; inputs.hyprland.follows = "hyprland"; }; }; @@ -30,6 +34,7 @@ home-manager.extraSpecialArgs = { inherit inputs; }; } ]; + specialArgs = { inherit inputs; }; }; }; } diff --git a/home-manager/drew.nix b/home-manager/drew.nix index 7c6faa8..95838f7 100644 --- a/home-manager/drew.nix +++ b/home-manager/drew.nix @@ -3,6 +3,7 @@ imports = [ ./features/shell.nix ./features/terminal.nix + ./features/hyprland.nix ]; home.username = "drew"; @@ -83,21 +84,6 @@ }; }; - # required for default hyprland config. - # programs.kitty.enable = true; - # wayland.windowManager.hyprland = { - # enable = true; - # package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - # settings = { - # "$mod" = "SUPER + ALT"; - # }; - # plugins = [ - # inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hy3 - # ]; - # # Disable systemd because it conflicts with UWSM - # systemd.enable = false; - # }; - # Hint for electron apps to use wayland home.sessionVariables.NIXOS_OZONE_WL = "1"; @@ -116,14 +102,6 @@ }; }; - wayland.windowManager.hyprland = { - enable = true; - plugins = with inputs.hyprland-plugins.packages.${pkgs.system}; [ - hy3 - split-monitor-workspace - ]; - }; - qt = { enable = true; platformTheme.name = "adwaita"; diff --git a/home-manager/features/hyprland.nix b/home-manager/features/hyprland.nix new file mode 100644 index 0000000..f65f20f --- /dev/null +++ b/home-manager/features/hyprland.nix @@ -0,0 +1,416 @@ +{ pkgs, inputs, ... }: +{ + wayland.windowManager.hyprland = { + enable = true; + plugins = [ + inputs.hy3.packages.${pkgs.system}.hy3 + inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + + # Disable systemd because it conflicts with UWSM + systemd.enable = false; + + settings = { + monitor = [ + "DP-2, 3440x1440, 0x0, 1" + "DP-1, 2560x1440, -1440x-510, 1, transform, 1" + ]; + + "$terminal" = "alacritty"; + "$fileManager" = "dolphin"; + "$menu" = "wofi --show drun,run"; + "$browser" = "firefox"; + + exec-once = [ + "nm-applet &" + "sleep 1 && eww open-many primary-statusbar secondary-statusbar launcher &" + "sleep 1 && hyprpaper &" + "sleep 2 && hyprpm reload -n" + "swayidle -w before-sleep hyprlock &" + "swayosd-server &" + "systemctl --user start hyprpolkitagent" + ]; + + env = [ + "XCURSOR_SIZE,24" + "HYPRCURSOR_SIZE,24" + "HYPRCURSOR_THEME,phinger" + + # Nvidia config + "LIBVA_DRIVER_NAME,nvidia" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + + # For window theming + "QT_QPA_PLATFORMTHEME,qt6ct # for Qt apps" + "GTK_THEME,Adwaita-dark" + ]; + + general = { + gaps_in = 5; + gaps_out = 10; + + border_size = 2; + + # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors + "col.active_border" = "rgba(eeeeffee) rgba(3366ffee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + + # Set to true enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = false; + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false; + + layout = "hy3"; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#decoration + decoration = { + rounding = 5; + + # Change transparency of focused and unfocused windows + active_opacity = 1.0; + inactive_opacity = 1.0; + + shadow = { + enabled = true; + range = 5 ; + render_power = 3; + color = "rgba(1a1a1aee)"; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#blur + blur = { + enabled = true; + size = 3; + passes = 1; + vibrancy = 0.1696; + }; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#animations + animations = { + enabled = "yes"; + + # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = [ + "easeOutQuint,0.23,1,0.32,1" + "easeInOutCubic,0.65,0.05,0.36,1" + "linear,0,0,1,1" + "almostLinear,0.5,0.5,0.75,1.0" + "quick,0.15,0,0.1,1" + ]; + + animation = [ + "global, 1, 10, default" + "border, 1, 5.39, easeOutQuint" + "windows, 1, 4.79, easeOutQuint" + "windowsIn, 1, 4.1, easeOutQuint, popin 87%" + "windowsOut, 1, 1.49, linear, popin 87%" + "fadeIn, 1, 1.73, almostLinear" + "fadeOut, 1, 1.46, almostLinear" + "fade, 1, 3.03, quick" + "layers, 1, 3.81, easeOutQuint" + "layersIn, 1, 4, easeOutQuint, fade" + "layersOut, 1, 1.5, linear, fade" + "fadeLayersIn, 1, 1.79, almostLinear" + "fadeLayersOut, 1, 1.39, almostLinear" + "workspaces, 1, 1.94, almostLinear, fade" + "workspacesIn, 1, 1.21, almostLinear, fade" + "workspacesOut, 1, 1.94, almostLinear, fade" + ]; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#misc + misc = { + force_default_wallpaper = 0; # Set to 0 or 1 to disable the anime mascot wallpapers + disable_hyprland_logo = true; # If true disables the random hyprland logo / anime girl background. :( + }; + + cursor = { + no_hardware_cursors = true; + }; + + ############### + ### PLUGINS ### + ############### + + plugin = { + hy3 = { + # disable gaps when only one window is onscreen + # 0 - always show gaps + # 1 - hide gaps with a single window onscreen + # 2 - 1 but also show the window border + no_gaps_when_only = 0; # default: 0 + + # policy controlling what happens when a node is removed from a group, + # leaving only a group + # 0 = remove the nested group + # 1 = keep the nested group + # 2 = keep the nested group only if its parent is a tab group + node_collapse_policy = 2; # default: 2 + + # offset from group split direction when only one window is in a group + group_inset = 10; # default: 10 + + # if a tab group will automatically be created for the first window spawned in a workspace + tab_first_window = false; + + # tab group settings + tabs = { + # height of the tab bar + height = 20; # default: 15 + + # padding between the tab bar and its focused node + # padding = # default: 5 + + # the tab bar should animate in/out from the top instead of below the window + # from_top = # default: false + + # rounding of tab bar corners + rounding = 2; # default: 3 + + # render the window title on the bar + # render_text = # default: true + + # center the window title + # text_center = # default: false + + # font to render the window title with + # text_font = # default: Sans + + # height of the window title + text_height = 10; # default: 8 + + # left padding of the window title + # text_padding = # default: 3 + + # active tab bar segment color + # col.active = # default: 0xff32b4ff + + # urgent tab bar segment color + # col.urgent = # default: 0xffff4f4f + + # inactive tab bar segment color + # col.inactive = # default: 0x80808080 + + # active tab bar text color + # col.text.active = # default: 0xff000000 + + # urgent tab bar text color + # col.text.urgent = # default: 0xff000000 + + # inactive tab bar text color + # col.text.inactive = # default: 0xff000000 + }; + + # autotiling settings + autotile = { + # enable autotile + # enable = # default: false + + # make autotile-created groups ephemeral + # ephemeral_groups = # default: true + + # if a window would be squished smaller than this width, a vertical split will be created + # -1 = never automatically split vertically + # 0 = always automatically split vertically + # = pixel width to split at + # trigger_width = # default: 0 + + # if a window would be squished smaller than this height, a horizontal split will be created + # -1 = never automatically split horizontally + # 0 = always automatically split horizontally + # = pixel height to split at + # trigger_height = # default: 0 + + # a space or comma separated list of workspace ids where autotile should be enabled + # it's possible to create an exception rule by prefixing the definition with "not:" + # workspaces = 1,2 # autotiling will only be enabled on workspaces 1 and 2 + # workspaces = not:1,2 # autotiling will be enabled on all workspaces except 1 and 2 + # workspaces = # default: all + }; + }; + + split-monitor-workspaces = { + # Keep the focus when reloading. + keep_focused = true; + # Don't pre-allocate workspaces. + enable_persistent_workspaces = false; + }; + }; + + ############# + ### INPUT ### + ############# + + # https://wiki.hyprland.org/Configuring/Variables/#input + input = { + kb_layout = "us"; + # kb_variant = + # kb_model = + kb_options = "compose:ralt"; + # kb_rules = + + follow_mouse = 1; + + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + + touchpad = { + natural_scroll = false; + }; + }; + + # Example per-device config + # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more + device = { + name = "logitech-g502-1"; + sensitivity = -0.2; + }; + + + ################### + ### KEYBINDINGS ### + ################### + + # See https://wiki.hyprland.org/Configuring/Keywords/ + "$mainMod" = "SUPER + ALT"; + + bind = [ + "$mainMod, T, exec, $terminal" + "$mainMod, B, exec, $browser" + "$mainMod, D, exec, $menu" + "$mainMod, E, exec, $fileManager" + "$mainMod + SHIFT, S, exec, flameshot gui" + "$mainMod, C, exec, swaync-client -t" + + "$mainMod + L_CONTROL, Q, exit," + "$mainMod, X, exec, hyprlock" + "$mainMod + SHIFT, X, exec, systemctl suspend" + + "$mainMod, F, togglefloating," + "$mainMod + SHIFT, F, fullscreen, 1" + + # Monitors + "$mainMod, R, focusmonitor, l" + "$mainMod, S, focusmonitor, r" + "$mainMod + CTRL, R, movecurrentworkspacetomonitor, l" + "$mainMod + CTRL, S, movecurrentworkspacetomonitor, r" + + # Hy3 Stuff + "$mainMod, Q, hy3:killactive," + "$mainMod, G, hy3:makegroup, opposite, ephemeral" + "$mainMod, W, hy3:makegroup, tab, ephemeral" + "$mainMod + SHIFT, W, hy3:changegroup, toggletab" + "$mainMod, O, hy3:changegroup, opposite" + "$mainMod, left, hy3:movefocus, l" + "$mainMod, right, hy3:movefocus, r" + "$mainMod, up, hy3:movefocus, u" + "$mainMod, down, hy3:movefocus, d" + "$mainMod, A, hy3:changefocus, raise" + "$mainMod, Z, hy3:changefocus, lower" + "$mainMod + SHIFT, left, hy3:movewindow, l" + "$mainMod + SHIFT, right, hy3:movewindow, r" + "$mainMod + SHIFT, up, hy3:movewindow, u" + "$mainMod + SHIFT, down, hy3:movewindow, d" + # Switch workspaces with mainMod + [0-9] + "$mainMod, 1, split-workspace, 1" + "$mainMod, 2, split-workspace, 2" + "$mainMod, 3, split-workspace, 3" + "$mainMod, 4, split-workspace, 4" + "$mainMod, 5, split-workspace, 5" + "$mainMod, 6, split-workspace, 6" + "$mainMod, 7, split-workspace, 7" + "$mainMod, 8, split-workspace, 8" + "$mainMod, 9, split-workspace, 9" + "$mainMod, 0, split-workspace, 10" + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mainMod SHIFT, 1, split-movetoworkspace, 1, follow" + "$mainMod SHIFT, 2, split-movetoworkspace, 2, follow" + "$mainMod SHIFT, 3, split-movetoworkspace, 3, follow" + "$mainMod SHIFT, 4, split-movetoworkspace, 4, follow" + "$mainMod SHIFT, 5, split-movetoworkspace, 5, follow" + "$mainMod SHIFT, 6, split-movetoworkspace, 6, follow" + "$mainMod SHIFT, 7, split-movetoworkspace, 7, follow" + "$mainMod SHIFT, 8, split-movetoworkspace, 8, follow" + "$mainMod SHIFT, 9, split-movetoworkspace, 9, follow" + "$mainMod SHIFT, 0, split-movetoworkspace, 10, follow" + # These don't take monitor numbers, but rather differences. It's next/prev but + # it'll always just move it to the other monitor + "$mainMod SHIFT, r, split-changemonitor, prev" + ]; + + # m = mouse bindings + bindm = [ + "$mainMod, mouse:272, hy3:movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + # n = non-consuming + bindn = [ + ", mouse:272, hy3:focustab, mouse" + ]; + + # l = available when locked + bindl = [ + # Laptop multimedia keys for volume and LCD brightness + ",XF86AudioRaiseVolume, exec, swayosd-client --output-volume raise" + ",XF86AudioLowerVolume, exec, swayosd-client --output-volume lower" + ",XF86AudioMute, exec, swayosd-client --output-volume mute-toggle" + ",XF86AudioMicMute, exec, swayosd-client --input-volume mute-toggle" + ",XF86MonBrightnessUp, exec, brightnessctl s 10%+" + ",XF86MonBrightnessDown, exec, brightnessctl s 10%-" + # Requires playerctl + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPause, exec, playerctl play-pause" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPrev, exec, playerctl previous" + ]; + + ############################## + ### WINDOWS AND WORKSPACES ### + ############################## + + # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + windowrulev2 = [ + # Ignore maximize requests from apps. You'll probably like this. + "suppressevent maximize, class:.*" + + # Fix some dragging issues with XWayland + "nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" + + # Make right-click backgrounds not transparent. The menus have no class or title. + "opaque,class:(),title:()" + "noshadow,class:(),title:()" + "noblur,class:(),title:()" + + # Set up full-screen games on monitor 1 + "monitor 1,class:^steam_app_\d+$" + "float,class:^steam_app_\d+$" + "monitor 1,fullscreen:1" + "center,class:^steam_app_\d+$" + + "monitor 1,class:wow.exe" + "monitor 1,title:^Battle.net$" + "float,title:^Battle.net$" + ]; + + # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules + workspace = [ + "11, defaultName:1" + "12, defaultName:2" + "13, defaultName:3" + "14, defaultName:4" + "15, defaultName:5" + "16, defaultName:6" + "17, defaultName:7" + "18, defaultName:8" + "19, defaultName:9" + "20, defaultName:10" + ]; + }; + }; +} + diff --git a/home-manager/features/shell.nix b/home-manager/features/shell.nix index 39a27d6..6d89e3c 100644 --- a/home-manager/features/shell.nix +++ b/home-manager/features/shell.nix @@ -10,9 +10,6 @@ # Make ^U work like it does in Bash bindkey "^U" backward-kill-line - # Disable the extra characters when pasting - unsetopt bracketedpaste - alias 'p?'='ps ax | grep' ''; oh-my-zsh = {