summaryrefslogtreecommitdiff
path: root/nixos/hypr.nix
blob: e19e14562680f4b1c91097a5d0ec5893e33f23c0 (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
{ pkgs, ... }:

{
  xdg.configFile."hypr/hyprland.conf".force = true;

  wayland.windowManager.hyprland = {
    enable = true;
    configType = "hyprlang";

    extraConfig = ''
      source = ~/.cache/wal/colors-hyprland.conf

      monitor = HDMI-A-1, 1920x1080@200, 0x0, 1
      monitor = DP-1, 1920x1080@144, -1080x-330, 1, transform, 3

      $mod = super
      $terminal = kitty
      $filemanager = nautilus
      $menu = rofi -show drun
      $browser = helium

      exec-once = systemctl --user start hyprpolkitagent
      exec-once = awww-daemon & sleep 0.5 && awww clear --outputs DP-1
      exec-once = wl-paste --type text --watch cliphist store
      exec-once = wl-paste --type image --watch cliphist store
      exec-once = waybar

      general {
          gaps_in = 5 # @dynamic_gaps_in
          gaps_out = 10 # @dynamic_gaps_out
          border_size = 1 # @dynamic_border
          resize_on_border = 0
          col.active_border = $color2
          allow_tearing = 0
          layout = dwindle
      }

      decoration {
          rounding = 0
          rounding_power = 0
          active_opacity = 1
          inactive_opacity = 1
          shadow {
              enabled = 1
              range = 4
              render_power = 3
              color = rgba(1a1a1aee)
          }
          blur {
              enabled = 1
              size = 3
              passes = 3
              vibrancy = 0
          }
      }

      animations {
          enabled = yes
          bezier = easeOutQuint, 0.20, 1, 0.30, 1
          bezier = easeInOutCubic, 0.65, 0.05, 0.35, 1
          bezier = linear, 0, 0, 1, 1
          bezier = almostLinear, 0.5, 0.5, 0.75, 1
          bezier = quick, 0.15, 0, 0.1, 1
          bezier = hard, 0, 1, 0, 1
          animation = global, 1, 5, default
          animation = border, 1, 2.5, easeOutQuint
          animation = windows, 1, 2.5, easeOutQuint
          animation = windowsIn, 1, 2, easeOutQuint, popin 90%
          animation = windowsOut, 1, 1, linear, popin 90%
          animation = fadeIn, 1, 1, almostLinear
          animation = fadeOut, 1, 1, almostLinear
          animation = fade, 1, 1.5, quick
          animation = layers, 1, 2, easeOutQuint
          animation = layersIn, 1, 2, easeOutQuint, fade
          animation = layersOut, 1, 1, linear, fade
          animation = workspaces, 1, 1, almostLinear, fade # @dynamic_workspaces
          animation = specialWorkspace, 1, 1, almostLinear, fade # @dynamic_special
      }

      input {
          kb_layout = us
          follow_mouse = 1
          sensitivity = 0
          force_no_accel = 0
          touchpad {
              natural_scroll = 0
          }
      }

      misc {
          force_default_wallpaper = 0
          disable_hyprland_logo = 1
          disable_splash_rendering = 1
          initial_workspace_tracking = 1
      }

      dwindle {
          preserve_split = 1
      }

      windowrule {
          name = mv
          match:initial_class = ^(imv|mpv)$
          float = on
          center = on
          size = 600 600
      }

      workspace = w[t1], gapsout:0, gapsin:0, border:0, rounding:false # @dynamic_smartgaps
      workspace = f[1], gapsout:0, gapsin:0, border:0, rounding:false # @dynamic_smartgaps

      bind = $mod, Q, exec, $terminal
      bind = $mod, E, exec, $filemanager
      bind = $mod, B, exec, $browser
      bind = $mod, R, exec, $menu
      bind = $mod, C, killactive
      bind = $mod, V, togglefloating
      bind = $mod, F, fullscreen, 0
      bind = $mod, Tab, workspace, m+1
      bind = $mod, T, exec, master
      bind = $mod, W, exec, pkill -SIGUSR1 waybar
      bind = $mod, P, exec, bash -c '[[ -f /tmp/hyprpickerlock ]] && exit; touch /tmp/hyprpickerlock; hyprpicker --no-zoom --autocopy; rm -f /tmp/hyprpickerlock'
      bind = alt, S, exec, bash -c '[[ -f /tmp/slurplock ]] && exit; touch /tmp/slurplock; mkdir -p /home/silly/Pictures/screenshots; f="/home/silly/Pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png"; grim -g "$(slurp)" "$f" && wl-copy < "$f"; rm -f /tmp/slurplock'

      bind = $mod, left, movefocus, l
      bind = $mod, right, movefocus, r
      bind = $mod, up, movefocus, u
      bind = $mod, down, movefocus, d

      bind = shift, left, movewindow, l
      bind = shift, right, movewindow, r
      bind = shift, up, movewindow, u
      bind = shift, down, movewindow, d

      bind = $mod, 1, workspace, 1
      bind = $mod, 2, workspace, 2
      bind = $mod, 3, workspace, 3
      bind = $mod, 4, workspace, 4
      bind = $mod, 5, workspace, 5
      bind = $mod, 6, workspace, 6
      bind = $mod, 7, workspace, 7
      bind = $mod, 8, workspace, 8
      bind = $mod, 9, workspace, 9
      bind = $mod, 0, workspace, 10

      bind = $mod shift, 1, movetoworkspace, 1
      bind = $mod shift, 2, movetoworkspace, 2
      bind = $mod shift, 3, movetoworkspace, 3
      bind = $mod shift, 4, movetoworkspace, 4
      bind = $mod shift, 5, movetoworkspace, 5
      bind = $mod shift, 6, movetoworkspace, 7
      bind = $mod shift, 7, movetoworkspace, 7
      bind = $mod shift, 8, movetoworkspace, 8
      bind = $mod shift, 9, movetoworkspace, 9
      bind = $mod shift, 0, movetoworkspace, 10

      bind = $mod, S, togglespecialworkspace, magic
      bind = $mod shift, S, movetoworkspace, special:magic

      bind = $mod, mouse_down, workspace, e+1
      bind = $mod, mouse_up, workspace, e-1
      bindm = $mod, mouse:272, movewindow
      bindm = $mod, mouse:273, resizewindow
    '';
  };
}