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, ... }:
{
services.hyprpaper = {
enable = true;
settings = {
ipc = "on";
preload = [
"/etc/nixos/home/wallpapers/owl1.webp"
"/etc/nixos/home/wallpapers/owl2.webp"
"/etc/nixos/home/wallpapers/owl3.webp"
];
wallpaper = [ ", /etc/nixos/home/wallpapers/owl1.webp" ];
};
};
services.hyprpolkitagent.enable = true;
services.hypridle = {
enable = true;
settings = {
general = {
after_sleep_cmd = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
ignore_dbus_inhibit = false;
lock_cmd = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
};
listener = [
{
timeout = 300;
on-timeout = "${pkgs.brightnessctl}/bin/brightnessctl -s set 10";
on-resume = "${pkgs.brightnessctl}/bin/brightnessctl -r";
}
{
timeout = 600;
on-timeout = "${pkgs.systemd}/bin/loginctl lock-session";
}
{
timeout = 900; # 15 minutes
on-timeout = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 1800;
on-timeout = "${pkgs.systemd}/bin/systemctl suspend";
}
];
};
};
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.hyprland;
systemd = {
variables = [ "--all" ];
enable = true;
enableXdgAutostart = true;
};
extraConfig = ''
gesture = 3, up, dispatcher, fullscreen 1
gesture = 3, down, dispatcher, fullscreen 1
gesture = 4, up, dispatcher, fullscreen 0
gesture = 4, down, dispatcher, fullscreen 0
gesture = 2, pinchout, dispatcher, splitratio 0.1 # approximating clockwise to pinchout
gesture = 2, pinchin, dispatcher, splitratio -0.1 # approximating anticlockwise to pinchin
gesture = 4, pinchin, close
gesture = 4, pinchout, dispatcher, exec ${pkgs.ghostty}/bin/ghostty
gesture = 2, left, dispatcher, workspace 1 # approximating left_up/left_down to left/right/up/down
gesture = 2, down, dispatcher, workspace 2
gesture = 2, right, dispatcher, workspace 3
gesture = 2, up, dispatcher, workspace 4
exec-once = ${pkgs.hyprlock}/bin/hyprlock --immediate;
'';
xwayland.enable = true;
settings = {
monitor = ", preferred, auto, 1";
general = {
gaps_out = 10;
};
input = {
kb_layout = "us,fi";
kb_options = "grp:alt_shift_toggle";
scroll_method = "on_button_down";
scroll_button = 274;
sensitivity = 0; # -1.0 - 1.0, 0 means no modification
repeat_delay = 180;
repeat_rate = 150;
touchpad = {
natural_scroll = true;
disable_while_typing = true;
tap-to-click = true;
middle_button_emulation = true;
};
};
decoration = {
dim_inactive = true;
};
misc = {
disable_hyprland_logo = true;
disable_splash_rendering = true;
middle_click_paste = true;
};
"$mainMod" = "SUPER";
bind = [
"$mainMod, V, exec, ${pkgs.ghostty}/bin/ghostty --class clipse -e 'clipse' "
"$mainMod, Return, exec, ${pkgs.ghostty}/bin/ghostty"
"$mainMod, d, exec, ${pkgs.walker}/bin/walker --modules applications,translation,webesearch,clipboard,finder"
"$mainMod, B, exec, ${pkgs.firefox}/bin/firefox"
"$mainMod, F, fullscreen"
"$mainMod, C, killactive,"
"$mainMod, Tab, cyclenext"
", Print, exec, ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy && ${pkgs.wl-clipboard}/bin/wl-paste > ~/Pictures/screenshots/Screenshot-$(date +%F_%T).png && ${pkgs.dunst}/bin/dunstify 'Screenshot of the whole screen taken' -t 1000"
", XF86MonBrightnessUp, exec, brightnessctl s -e 5%+"
", XF86MonBrightnessDown, exec, brightnessctl s -e 5%-"
", XF86AudioRaiseVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume,exec,wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
"$mainMod SHIFT, L, exec, hyprlock"
# Move focus with mainMod + arrow keys
"$mainMod, left, movefocus, l"
"$mainMod, right, movefocus, r"
"$mainMod, up, movefocus, u"
"$mainMod, down, movefocus, d"
"$mainMod, H, movefocus, l"
"$mainMod, L, movefocus, r"
"$mainMod, K, movefocus, u"
"$mainMod, J, movefocus, d"
"$mainMod SHIFT, left, swapwindow, l"
"$mainMod SHIFT, right, swapwindow, r"
"$mainMod SHIFT, up, swapwindow, u"
"$mainMod SHIFT, down, swapwindow, d"
# Switch workspaces with mainMod + [0-9]
"$mainMod, 1, workspace, 1"
"$mainMod, 2, workspace, 2"
"$mainMod, 3, workspace, 3"
"$mainMod, 4, workspace, 4"
"$mainMod, 5, workspace, 5"
"$mainMod, 6, workspace, 6"
"$mainMod, 7, workspace, 7"
"$mainMod, 8, workspace, 8"
"$mainMod, 9, workspace, 9"
"$mainMod, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"$mainMod SHIFT, 1, movetoworkspace, 1"
"$mainMod SHIFT, 2, movetoworkspace, 2"
"$mainMod SHIFT, 3, movetoworkspace, 3"
"$mainMod SHIFT, 4, movetoworkspace, 4"
"$mainMod SHIFT, 5, movetoworkspace, 5"
"$mainMod SHIFT, 6, movetoworkspace, 6"
"$mainMod SHIFT, 7, movetoworkspace, 7"
"$mainMod SHIFT, 8, movetoworkspace, 8"
"$mainMod SHIFT, 9, movetoworkspace, 9"
"$mainMod SHIFT, 0, movetoworkspace, 10"
];
binde = [ ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" ];
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
};
};
}
|