-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsway.nix
329 lines (319 loc) · 9.98 KB
/
sway.nix
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
{ lib,config, pkgs, ... }:
let modifier = config.wayland.windowManager.sway.config.modifier;
in
{
wayland.windowManager.sway={
enable=true;
wrapperFeatures={
gtk=true;
base=true;
};
xwayland=true;
package=pkgs.sway;
#extraPackages= with pkgs; [
#swayidle foot dmenu wmenu
# ];
config = rec {
modifier = "Mod4";
terminal = "kitty";
startup = [ #{always=false;
#command="firefox";}
{command = "swaybg -i $HOME/github/nixos-sway-basic/background.png";}
];
down="j";
bars=[{ colors={
background = "#5f676a";
focusedBackground="#002776";
focusedSeparator="#ff2800";
#focusedStatusline="#002776";
separator="#444444";
#statusline="002776";
bindingMode={
background = "#900000";
border = "#2f343a";
text = "#ffffff";
};
activeWorkspace={
background = "#000000";
border = "#333333";
text = "#ffffff";
};
focusedWorkspace={
background = "#ffdf00";
border = "#4c7899";
text = "#444444";
};
inactiveWorkspace={
background = "#009c3b";
border = "#333333";
text = "#ffffff";
};
urgentWorkspace={
background = "#900000";
border = "#2f343a";
text = "#ffffff";
};
};
fonts={
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
style = "Bold Semi-Condensed";
size = 10.0;
};
command="${pkgs.sway}/bin/swaybar";
hiddenState="show";
mode="dock";
position="top";
statusCommand="${pkgs.i3status}/bin/i3status";
trayPadding=2;
workspaceButtons=true;
workspaceNumbers=true;
}];
fonts={
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
style = "Bold Semi-Condensed";
size = 11.0;
};
colors={
background="#ffdf00";
focused={
background = "#285577";
border = "#4c7899";
childBorder = "#285577";
indicator = "#2e9ef4";
text = "#ffffff";
};
focusedInactive={
background = "#5f676a";
border = "#333333";
childBorder = "#5f676a";
indicator = "#484e50";
text = "#ffffff";
};
placeholder={
background = "#0c0c0c";
border = "#000000";
childBorder = "#0c0c0c";
indicator = "#000000";
text = "#ffffff";
};
unfocused={
background = "#222222";
border = "#333333";
childBorder = "#222222";
indicator = "#292d2e";
text = "#888888";
};
urgent={
background = "#900000";
border = "#2f343a";
childBorder = "#900000";
indicator = "#900000";
text = "#ffffff";
};
};
defaultWorkspace="workspace number 1";
floating={
border=2;
criteria=[
{
title = "Steam - Update News";
}
{
class = "Pavucontrol";
}
];
modifier="Mod4";
titlebar=true;
};
focus={
followMouse="yes";
wrapping="no";
mouseWarping=true;
newWindow="focus";
};
gaps={
bottom=1;
horizontal=2;
inner=3;
left=1;
outer=3;
right=1;
smartBorders="off";
smartGaps=false;
top=2;
vertical=2;
};
input={
"type:keyboard"={
xkb_layout="br";
xkb_variant= "nodeadkeys";
};
};
keybindings={
#"${modifier}+Return" =lib.mkOptionDefault "exec ${pkgs.kitty}/bin/kitty";
#"${modifier}+Shift+q" = lib.mkOptionDefault "kill";
#"${modifier}+d" = lib.mkOptionDefault "exec ${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
"${modifier}+0" = lib.mkOptionDefault "workspace number 10";
"${modifier}+1" = lib.mkOptionDefault "workspace number 1";
"${modifier}+2" = lib.mkOptionDefault "workspace number 2";
"${modifier}+3" = lib.mkOptionDefault "workspace number 3";
"${modifier}+4" = lib.mkOptionDefault "workspace number 4";
"${modifier}+5" = lib.mkOptionDefault "workspace number 5";
"${modifier}+6" = lib.mkOptionDefault "workspace number 6";
"${modifier}+7" = lib.mkOptionDefault "workspace number 7";
"${modifier}+8" = lib.mkOptionDefault "workspace number 8";
"${modifier}+9" = lib.mkOptionDefault "workspace number 9";
"${modifier}+Down" = lib.mkOptionDefault "focus down";
"${modifier}+Left" = lib.mkOptionDefault "focus left";
"${modifier}+Up" = lib.mkOptionDefault "focus up";
"${modifier}+Return" = lib.mkOptionDefault "exec kitty";
"${modifier}+Right" = lib.mkOptionDefault "focus right";
"${modifier}+Shift+0" = lib.mkOptionDefault "move container to workspace number 10";
"${modifier}+Shift+1" = lib.mkOptionDefault "move container to workspace number 1";
"${modifier}+Shift+2" = lib.mkOptionDefault "move container to workspace number 2";
"${modifier}+Shift+3" = lib.mkOptionDefault "move container to workspace number 3";
"${modifier}+Shift+4" = lib.mkOptionDefault "move container to workspace number 4";
"${modifier}+Shift+5" = lib.mkOptionDefault "move container to workspace number 5";
"${modifier}+Shift+6" = lib.mkOptionDefault "move container to workspace number 6";
"${modifier}+Shift+7" = lib.mkOptionDefault "move container to workspace number 7";
"${modifier}+Shift+8" = lib.mkOptionDefault "move container to workspace number 8";
"${modifier}+Shift+9" = lib.mkOptionDefault "move container to workspace number 9";
"${modifier}+Shift+Down" = lib.mkOptionDefault "move down";
"${modifier}+Shift+Left" = lib.mkOptionDefault "move left";
"${modifier}+Shift+Right" = lib.mkOptionDefault "move right";
"${modifier}+Shift+Up" = lib.mkOptionDefault "move up";
"${modifier}+Shift+c" = lib.mkOptionDefault "reload";
"${modifier}+Shift+e" = lib.mkOptionDefault "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exi>";
"${modifier}+Shift+h" = lib.mkOptionDefault "move left";
"${modifier}+Shift+j" = lib.mkOptionDefault "move down";
"${modifier}+Shift+k" = lib.mkOptionDefault "move up";
"${modifier}+Shift+l" = lib.mkOptionDefault "move right";
"${modifier}+Shift+minus" = lib.mkOptionDefault "move scratchpad";
"${modifier}+Shift+q" = lib.mkOptionDefault "kill";
"${modifier}+Shift+space" = lib.mkOptionDefault "floating toggle";
#"${modifier}+Up" = lib.mkOptionDefault "focus up";
"${modifier}+a" = lib.mkOptionDefault "focus parent";
"${modifier}+b" = lib.mkOptionDefault "splith";
"${modifier}+d" = lib.mkOptionDefault "exec ${pkgs.wmenu}/bin/wmenu-run";
"${modifier}+e" = lib.mkOptionDefault "layout toggle split";
"${modifier}+f" = lib.mkOptionDefault "fullscreen toggle";
"${modifier}+h" = lib.mkOptionDefault "focus left";
"${modifier}+j" = lib.mkOptionDefault "focus down";
"${modifier}+k" = lib.mkOptionDefault "focus up";
"${modifier}+l" = lib.mkOptionDefault "focus right";
"${modifier}+minus" = lib.mkOptionDefault "scratchpad show";
"${modifier}+r" = lib.mkOptionDefault "mode resize";
"${modifier}+s" = lib.mkOptionDefault "layout stacking";
"${modifier}+space" = lib.mkOptionDefault "focus mode_toggle";
"${modifier}+v" = lib.mkOptionDefault "splitv";
"${modifier}+w" = lib.mkOptionDefault "layout tabbed";
#Audio
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ +10%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -10%";
"XF86AudioMute" = "exec set-volume toggle-mute";
#"XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl stop";
#"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
#"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
#"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86MonBrightnessDown" = "exec brightnessctl set 15%-";
"XF86MonBrightnessUp" = "exec brightnessctl set +15%";
};
left="h";
menu="\${pkgs.wmenu}/bin/wmenu_path | \${pkgs.wmenu}/bin/wmenu | \${pkgs.findutils}/bin/xargs swaymsg exec --";
modes={
resize = {
Down = "resize grow height 10 px";
Escape = "mode default";
Left = "resize shrink width 10 px";
Return = "mode default";
Right = "resize grow width 10 px";
Up = "resize shrink height 10 px";
h = "resize shrink width 10 px";
j = "resize grow height 10 px";
k = "resize shrink height 10 px";
l = "resize grow width 10 px";
};
};
output={
HDMI-A-1 = {
#bg = "#AABBCC solid_color";
};
};
right="l";
seat={"*" = {hide_cursor = "when-typing enable";};};
up="k";
window={
border=3;
commands=[{
command = "border pixel 2";
criteria = {
title = "x200: ~/work";
floating = true;
};
}];
hideEdgeBorders="smart";
titlebar=true;
};
workspaceAutoBackAndForth=true;
workspaceLayout="default";
};
extraConfig=''
#input "type:keyboard" {
# xkb_layout br
# xkb_variant nodeadkeys
#}
'';
extraConfigEarly=''
'';
extraOptions=[
"--verbose"
"--debug"
#"--unsupported-gpu"
#"--my-next-gpu-wont-be-nvidia"
];
extraSessionCommands=''
export SDL_VIDEODRIVER=wayland
# needs qt5.qtwayland in systemPackages
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
export _JAVA_AWT_WM_NONREPARENTING=1
export XDG_CURRENT_DESKTOP=sway
'';
swaynag={
enable=true;
settings={
"<config>" = {
edge = "bottom";
font = "Dina 12";
};
green = {
edge = "top";
background = "00AA00";
text = "FFFFFF";
button-background = "00CC00";
message-padding = 10;
};
};
};
systemd={
enable=true;
extraCommands=[
"systemctl --user start sway-session.target"
];
variables=[
"DISPLAY"
"WAYLAND_DISPLAY"
"SWAYSOCK"
"XDG_CURRENT_DESKTOP"
"XDG_SESSION_TYPE"
"NIXOS_OZONE_WL"
"XCURSOR_THEME"
"XCURSOR_SIZE"
#"-all"
];
xdgAutostart=false;
};
};
}