Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 1 | { |
| 2 | pkgs, |
| 3 | config, |
| 4 | inputs, |
| 5 | system, |
| 6 | lib, |
| 7 | ... |
| 8 | }: |
| 9 | let |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 10 | lock = "${pkgs.waylock}/bin/waylock"; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 11 | in |
| 12 | { |
| 13 | options.chimera.hyprland = { |
| 14 | enable = lib.mkEnableOption "Use hyprland as your window manager"; |
| 15 | |
| 16 | monitors = lib.mkOption { |
| 17 | type = lib.types.listOf lib.types.str; |
| 18 | description = "List of default monitors to set"; |
| 19 | default = [ ]; |
| 20 | }; |
| 21 | }; |
| 22 | |
| 23 | /* general = { |
| 24 | gaps_in = 5; |
| 25 | gaps_out = 20; |
| 26 | |
| 27 | border_size = 1; |
| 28 | "col.active_border" = "rgba(71AEF5EE)"; |
| 29 | "col.inactive_border" = "rgba(C4C4C4EE)"; |
| 30 | |
| 31 | layout = "dwindle"; |
| 32 | }; |
| 33 | |
| 34 | dwindle = { |
| 35 | pseudotile = true; |
| 36 | smart_split = true; |
| 37 | }; |
| 38 | |
| 39 | master = { |
| 40 | allow_small_split = true; |
| 41 | new_is_master = true; |
| 42 | }; |
| 43 | |
| 44 | decoration = { |
| 45 | rounding = 7; |
| 46 | |
| 47 | drop_shadow = true; |
| 48 | shadow_range = 4; |
| 49 | shadow_render_power = 3; |
| 50 | "col.shadow" = "rgba(1a1a1aee)"; |
| 51 | }; |
| 52 | */ |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 53 | |
| 54 | # TODO: Eww, SwayNC, hyprland-per-window-layout, waylock, hy3, anyrun, hypr-empty |
| 55 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 56 | config = lib.mkIf config.chimera.hyprland.enable { |
| 57 | home.packages = [ pkgs.hyprpicker ]; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 58 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 59 | services.fusuma.settings.swipe = lib.mkIf config.chimera.touchpad.enable ( |
| 60 | let |
| 61 | hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl"; |
| 62 | jq = "${pkgs.jq}/bin/jq"; |
| 63 | awk = "${pkgs.gawk}/bin/awk"; |
| 64 | in |
| 65 | { |
| 66 | "3".up.command = "${hyprctl} dispatch fullscreen 0"; |
| 67 | "3".down.command = "${hyprctl} dispatch fullscreen 0"; |
| 68 | "4".down.command = lock; |
| 69 | "3".left.command = "${hyprctl} dispatch workspace $(${hyprctl} activeworkspace -j | ${jq} .id | ${awk} '{print $1+1}')"; |
| 70 | "3".right.command = "${hyprctl} dispatch workspace $(${hyprctl} activeworkspace -j | ${jq} .id | ${awk} '{print $1-1}')"; |
| 71 | } |
| 72 | ); |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 73 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 74 | wayland.windowManager.hyprland = { |
| 75 | enable = true; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 76 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 77 | xwayland.enable = true; |
| 78 | systemd.enable = true; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 79 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 80 | settings = |
| 81 | let |
| 82 | mod = "SUPER"; |
| 83 | terminal = "${pkgs.kitty}/bin/kitty"; |
| 84 | menu = "${inputs.anyrun.packages.${system}.anyrun}/bin/anyrun"; |
| 85 | in |
| 86 | { |
| 87 | misc = { |
| 88 | disable_hyprland_logo = true; |
| 89 | disable_splash_rendering = true; |
| 90 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 91 | |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 92 | exec-once = "${pkgs.hyprpaper}/bin/hyprpaper; hyprctl setcursor ${config.chimera.theme.cursor.name} ${builtins.toString config.chimera.theme.cursor.size}"; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 93 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 94 | monitor = config.chimera.hyprland.monitors ++ [ ",preferred,auto,1" ]; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 95 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 96 | decoration = { |
| 97 | rounding = 7; |
| 98 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 99 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 100 | input = { |
| 101 | kb_layout = "us"; |
| 102 | kb_variant = "dvorak"; |
| 103 | natural_scroll = true; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 104 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 105 | touchpad = { |
| 106 | natural_scroll = true; |
| 107 | }; |
| 108 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 109 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 110 | xwayland = { |
| 111 | force_zero_scaling = true; |
| 112 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 113 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 114 | dwindle = { |
| 115 | pseudotile = true; |
| 116 | smart_split = true; |
| 117 | }; |
| 118 | |
| 119 | master = { |
| 120 | allow_small_split = true; |
| 121 | new_is_master = true; |
| 122 | }; |
| 123 | |
| 124 | windowrulev2 = [ "opacity 1.0 0.85,title:(.*)" ]; |
| 125 | |
| 126 | bind = |
| 127 | [ |
| 128 | "${mod}, Q, killactive" |
| 129 | "${mod}, SPACE, togglefloating" |
| 130 | "${mod}, RETURN, exec, ${terminal}" |
| 131 | "${mod}, down, movefocus, d" |
| 132 | "${mod}, up, movefocus, u" |
| 133 | "${mod}, right, movefocus, r" |
| 134 | "${mod}, left, movefocus, l" |
| 135 | "${mod}, L, exec, ${lock}" |
| 136 | "${mod}, D, exec, ${menu}" |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 137 | ] |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 138 | ++ (builtins.concatLists ( |
| 139 | builtins.genList |
| 140 | ( |
| 141 | x: |
| 142 | let |
| 143 | ws = |
| 144 | let |
| 145 | c = (x + 1) / 10; |
| 146 | in |
| 147 | builtins.toString (x + 1 - (c * 10)); |
| 148 | in |
| 149 | [ |
| 150 | "${mod}, ${ws}, workspace, ${toString (x + 1)}" |
| 151 | "${mod} SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" |
| 152 | ] |
| 153 | ) |
| 154 | 10 |
| 155 | )); |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 156 | |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 157 | bindm = [ |
| 158 | "${mod}, mouse:272, movewindow" |
| 159 | "${mod}, mouse:273, resizewindow" |
| 160 | ]; |
| 161 | }; |
Skyler Grey | a0da6b2 | 2024-02-11 22:53:41 +0000 | [diff] [blame] | 162 | }; |
| 163 | }; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 164 | } |