-
Notifications
You must be signed in to change notification settings - Fork 1
/
sway
396 lines (319 loc) · 10.2 KB
/
sway
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
#### # # ## # # #### #### # # ###### # ####
# # # # # # # # # # # ## # # # # #
#### # # # # # # # # # # # ##### # #
# # ## # ###### # # # # # # # # # # ###
# # ## ## # # # # # # # # ## # # # #
#### # # # # # #### #### # # # # ####
#######################
#-- Not in the Repo --#
#######################
include /etc/sway/config.d/*
include ~/.config/sway/personal.config
include ~/.config/sway/local.config
#################
#-- Variables --#
#################
# keys
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
# applications
set $term alacritty
set $editor $term --title neovim -e nvim
set $file fish -c "$term --title FFF -e fff"
set $file2 thunar
set $browser firefox-developer-edition
set $menu $term --class fzfLauncher.fish -t fzfLauncher.fish -e fzfLauncher.fish
##################
#-- GTK themes --#
##################
set $gnome-schema org.gnome.desktop.interface
exec_always {
gsettings set $gnome-schema gtk-theme Yaru-Purple
gsettings set $gnome-schema icon-theme Yaru-Purple
gsettings set $gnome-schema cursor-theme Numix-Cursor-Maia
}
############################
#-- Output configuration --#
############################
exec_always background.sh &
exec monitor.sh r &
set $m1 = DP-2
set $m2 = HDMI-A-1
bindsym {
$mod+m exec monitor.sh # switch output
$mod+Shift+m exec rotate.sh # rotate output
$mod+Control+m exec monitor.sh r # refresh outputs
# move workspaces between outputs
$mod+Shift+left move workspace to left # Move workspace to screen 1
$mod+Shift+right move workspace to right # Move workspace to screeen 2
$mod+left focus output left # Focus screen 1
$mod+right focus output right # Focus screeen 2
}
###########################
#-- Input configuration --#
###########################
input type:keyboard {
xkb_layout it
xkb_options caps:swapescape
}
input "2:7:SynPS/2_Synaptics_TouchPad" {
tap enabled
natural_scroll enabled
}
################################
#-- Applications keybindings --#
################################
bindsym {
# basics
$mod+d exec $menu
$mod+Return exec $term
$mod+q kill
$mod+p exec $browser
$mod+o exec $file
$mod+Shift+o exec $file2
$mod+n exec dash -c "cd ~/prog/notes && $editor README.md" # start note app in a terminal
$mod+z exec $editor
# Special keys
XF86Search exec $browser #browsers
XF86Calculator exec gnome-calculator
XF86Explorer exec $file2 # file managers
Shift+XF86Explorer exec $file # file managers
XF86Tools exec qtcreator
Shift+XF86Tools exec eclipse
# exit
--release $mod+Ctrl+l exec swaylock-blur
--release $mod+Ctrl+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
--release $mod+Ctrl+s exec "systemctl suspend"
--release $mod+Ctrl+r exec swaynag -t warning -m 'You pressed the reboot shortcut. Do you really want to reboot off this computer?' -b 'Yes, reboot' 'systemctl -i reboot'
--release $mod+Ctrl+o exec swaynag -t warning -m 'You pressed the poweroff shortcut. Do you really want to power off this computer?' -b 'Yes, poweroff' 'systemctl poweroff'
# sway stuff
$mod+c reload
$mod+i exec swayinfo.sh
$mod+w exec winfocus
}
#####################
#-- Moving around --#
#####################
floating_modifier $mod normal
bindsym {
# Move your focus around
$mod+$left focus left
$mod+$down focus down
$mod+$up focus up
$mod+$right focus right
# Move the focused window with the same, but add Shift
$mod+Shift+$left move left
$mod+Shift+$down move down
$mod+Shift+$up move up
$mod+Shift+$right move right
}
##################
#-- Workspaces --#
##################
workspace back_and_forth yes
# Workspace variables:
set {
$ws1 " 1 "
$ws2 " 2 "
$ws3 " 3 "
$ws4 " 4 "
$ws5 " 5 "
$ws6 " 6 "
$ws7 " 7 "
$ws8 " 8 "
$ws9 " 9 "
$ws10 " 0 "
}
bindsym {
# Switch to workspace
$mod+1 workspace $ws1
$mod+2 workspace $ws2
$mod+3 workspace $ws3
$mod+4 workspace $ws4
$mod+5 workspace $ws5
$mod+6 workspace $ws6
$mod+7 workspace $ws7
$mod+8 workspace $ws8
$mod+9 workspace $ws9
$mod+0 workspace $ws10
# Move focused container to workspace
$mod+Shift+1 move container to workspace $ws1
$mod+Shift+2 move container to workspace $ws2
$mod+Shift+3 move container to workspace $ws3
$mod+Shift+4 move container to workspace $ws4
$mod+Shift+5 move container to workspace $ws5
$mod+Shift+6 move container to workspace $ws6
$mod+Shift+7 move container to workspace $ws7
$mod+Shift+8 move container to workspace $ws8
$mod+Shift+9 move container to workspace $ws9
$mod+Shift+0 move container to workspace $ws10
# Workspace next and prev
Ctrl+Alt+h workspace prev
Ctrl+Alt+l workspace next
# Move window to workspace next and prev
Ctrl+Alt+Shift+h move container to workspace prev
Ctrl+Alt+Shift+l move container to workspace next
$mod+u workspace back_and_forth # Worspace back and forth
}
####################
#-- Layout stuff --#
####################
bindsym {
# Switch the current container between different layout styles
$mod+s layout stacking
$mod+t layout tabbed
$mod+e layout toggle split
# next window will appear at the right
$mod+b splith
# next window will appear at the bottom
$mod+v splitv
# Make the current focus fullscreen
$mod+f fullscreen
# Toggle the current focus between tiling and floating mode
$mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
$mod+space focus mode_toggle
# Move focus to the parent container
$mod+a focus parent
}
###############
#-- Borders --#
###############
gaps {
inner 10
outer 0
}
default_border pixel 3
default_floating_border normal 3
smart_borders on
smart_gaps on
bindsym {
# inner gaps
Mod1+Shift+plus gaps inner current plus 5
Mod1+Shift+minus gaps inner current minus 5
Mod1+Control+plus gaps inner all plus 5
Mod1+Control+minus gaps inner all minus 5
# horizontal gaps
Mod1+Shift+left gaps horizontal current plus 5
Mod1+Shift+right gaps horizontal current minus 5
Mod1+Control+left gaps horizontal all plus 5
Mod1+Control+right gaps horizontal all minus 5
# vertical gaps
Mod1+Shift+up gaps vertical current plus 5
Mod1+Shift+down gaps vertical current minus 5
Mod1+Control+up gaps vertical all plus 5
Mod1+Control+down gaps vertical all minus 5
# reset vertical and horizontal gaps
Mod1+g exec "gapsBorderToggle.sh"
Mod1+Shift+g gaps outer current set 0
Mod1+Control+g gaps outer all set 0
Mod1+s exec "smartGapsBorderToggle.sh" # toggle smart gaps and borders together
}
##################
#-- Scratchpad --#
##################
bindsym {
# Move the currently focused window to the scratchpad
$mod+minus move scratchpad
# cycle through scratchpad windows
$mod+plus scratchpad show
}
###########################
#-- Resizing containers --#
###########################
bindsym $mod+r mode "resize"
set $resizeNorm 30px
set $resizeFast 90px
set $resizeSlow 10px
# Left shrink the containers width
# Down shrink the containers heigh
# up shrink the containers width
# right grow the containers height
mode "resize" {
Bindsym {
$left resize shrink width $resizeNorm
$down resize grow height $resizeNorm
$up resize shrink height $resizeNorm
$right resize grow width $resizeNorm
# move faster
Ctrl+$left resize shrink width $resizeFast
Ctrl+$down resize grow height $resizeFast
Ctrl+$up resize shrink height $resizeFast
Ctrl+$right resize grow width $resizeFast
# move slower
Shift+$left resize shrink width $resizeSlow
Shift+$down resize grow height $resizeSlow
Shift+$up resize shrink height $resizeSlow
Shift+$right resize grow width $resizeSlow
# Return to default mode
Return mode "default"
Escape mode "default"
}
}
##################
#-- Status Bar --#
##################
font UbuntuMono Nerd Font Mono Regular 14
bar {
swaybar_command waybar
}
##############
#-- Colors --#
##############
client.focused #9654D4 #9654D4 #FFFFFF #FFFFFF #9654D4
client.focused_inactive #1b0f26 #1b0f26 #888888 #FFFFFF #1b0f26
client.unfocused #333333 #333333 #888888 #FFFFFF #333333
client.urgent #C20000 #C20000 #FFFFFF #FFFFFF #C20000
###################
#-- Screenshots --#
###################
bindsym {
Print exec shot.sh "focused"
Control+Print exec shot.sh "all"
Shift+Print exec shot.sh "area"
$mod+Print exec colorPicker.sh
}
##################
#-- Brightness --#
##################
bindsym {
XF86MonBrightnessUp exec light.sh u
XF86MonBrightnessDown exec light.sh d
}
##############
#-- Volume --#
##############
bindsym {
XF86AudioRaiseVolume exec volume.sh up 5
XF86AudioLowerVolume exec volume.sh down 5
XF86AudioMute exec volume.sh audiomute
XF86AudioMicMute exec volume.sh micmute
}
#####################
#-- Load services --#
#####################
exec redshift -l 45.47:9.19 -t 6500:4500 -m wayland # start redshift at my latitude
exec_always killall mako && mako # notification server
exec update.sh
exec_always refreshFzfPath.fish
exec udiskie.sh $term
####################
#-- Window Rules --#
####################
workspace $ws10 output $m2
workspace $ws9 output $m2
for_window [app_id="pavucontrol"] move container to workspace $ws9
for_window [class="Pavucontrol"] move container to workspace $ws9
for_window [app_id="baobab"] floating enable
for_window [app_id="baobab"] border none
for_window [app_id="gnome-calculator"] floating enable
for_window [app_id="gnome-calculator"] border none
for_window [app_id="corectrl"] move container to workspace $ws9
for_window [app_id="wayPreviewServer"] floating enable
for_window [app_id="wayPreviewServer"] move position 500 50
for_window [app_id="fzfLauncher.fish"] floating enable, border pixel 10, sticky enable
for_window [app_id="Federico Guerinoni.qTsConverter"] floating enable
for_window [app_id="Federico Guerinoni.qTsConverter"] border normal 3