summaryrefslogtreecommitdiff
path: root/modules/home/hyprland/chernobyl/hyprland.nix
blob: 888b41e26d14aa217f5139051af1943f1d0c3254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
{ pkgs, ... }:

{
  wayland.windowManager.hyprland = {
    enable = true;
    plugins = with pkgs.hyprlandPlugins; [
      hyprbars
      borders-plus-plus
      hyprexpo
      hyprfocus
    ];
    settings = {
      "$mod" = "SUPER";

      # Monitor configuration
      monitor = ",preferred,auto,1.5";

      # Environment variables for Wayland rendering
      env = [
        "LIBVA_DRIVER_NAME,nvidia"
        "XDG_SESSION_TYPE,wayland"
        "GDK_SCALE,1"
        "OZONE_PLATFORM,wayland"
        "QT_QPA_PLATFORM,wayland"
        "QT_AUTO_SCREEN_SCALE_FACTOR,1"
        "SDL_VIDEODRIVER,wayland"
        "CLUTTER_BACKEND,wayland"
      ];

      # Startup commands
      exec-once = [
        "dunst"
        "nm-applet"
        "blueman-applet"
        "waybar"
      ];

      # Regular keybindings
      bind = [
        # Applications
        "$mod, N, exec, firefox"
        "$mod, RETURN, exec, kitty"
        "$mod, M, exec, rofi -show drun"
        "$mod SHIFT, M, exec, kitty nnn"
        "$mod SHIFT, S, exec, flameshot gui"
        "$mod CTRL, L, exec, hyprlock"

        # Window management
        "$mod SHIFT, Q, killactive"
        "$mod, F, fullscreen, 0"
        "$mod SHIFT, SPACE, togglefloating"
        "$mod, SPACE, focusurgentorlast"

        # Focus (h=left, j=down, k=up, l=right)
        "$mod, H, movefocus, l"
        "$mod, J, movefocus, d"
        "$mod, K, movefocus, u"
        "$mod, L, movefocus, r"

        # Move windows
        "$mod SHIFT, H, movewindow, l"
        "$mod SHIFT, J, movewindow, d"
        "$mod SHIFT, K, movewindow, u"
        "$mod SHIFT, L, movewindow, r"

        # Layout switching
        "$mod, S, layoutmsg, togglesplit"
        "$mod, W, layoutmsg, preselect l"
        "$mod, E, layoutmsg, preselect r"

        # Reload
        "$mod SHIFT, C, exec, hyprctl reload"

        # Workspaces (key codes for Czech layout)
        "$mod, code:10, workspace, 1"
        "$mod, code:11, workspace, 2"
        "$mod, code:12, workspace, 3"
        "$mod, code:13, workspace, 4"
        "$mod, code:14, workspace, 5"
        "$mod, code:15, workspace, 6"
        "$mod, code:16, workspace, 7"
        "$mod, code:17, workspace, 8"
        "$mod, code:18, workspace, 9"
        "$mod, code:19, workspace, 10"

        "$mod SHIFT, code:10, movetoworkspace, 1"
        "$mod SHIFT, code:11, movetoworkspace, 2"
        "$mod SHIFT, code:12, movetoworkspace, 3"
        "$mod SHIFT, code:13, movetoworkspace, 4"
        "$mod SHIFT, code:14, movetoworkspace, 5"
        "$mod SHIFT, code:15, movetoworkspace, 6"
        "$mod SHIFT, code:16, movetoworkspace, 7"
        "$mod SHIFT, code:17, movetoworkspace, 8"
        "$mod SHIFT, code:18, movetoworkspace, 9"
        "$mod SHIFT, code:19, movetoworkspace, 10"
      ];

      # Brightness keys (repeat when held)
      bindel = [
        ", XF86MonBrightnessUp, exec, brightnessctl set 10%+"
        ", XF86MonBrightnessDown, exec, brightnessctl set 10%-"
      ];

      # Audio keys (repeat when held)
      bindle = [
        ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
        ", XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"
      ];

      # Audio/Mic mute (no repeat)
      bindl = [
        ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
        ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
      ];

      # Mouse bindings
      bindm = [
        "$mod, mouse:272, movewindow"
        "$mod, mouse:273, resizewindow"
      ];

      # Window decoration
      general = {
        gaps_in = 5;
        gaps_out = 10;
        border_size = 3;
        "col.active_border" = "0xffb12cbf";
        "col.inactive_border" = "0xff4c4c4c";
        layout = "dwindle";
      };

      decoration = {
        rounding = 15;
        blur = {
          enabled = true;
          size = 3;
          passes = 1;
        };
        shadow = {
          enabled = true;
          range = 4;
          render_power = 3;
        };
      };

      animations = {
        enabled = true;
        animation = [
          "windows, 1, 7, default"
          "windowsOut, 1, 7, default, popin 80%"
          "border, 1, 10, default"
          "fade, 1, 7, default"
        ];
      };

      input = {
        kb_layout = "cz";
        kb_options = "eurosign:e,caps:escape";
        follow_mouse = 1;
      };

      dwindle = {
        pseudotile = true;
        preserve_split = true;
      };

      # Window rules for VSCode and other apps
      windowrulev2 = [
        "suppressevent maximize, class:.*"
        "windowrule=tile, class:^(VSCodium|Code)$"
      ];
    };
  };
}