This repository has been archived by the owner on Jul 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config
422 lines (343 loc) · 14.1 KB
/
config
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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
#### Sway configuration ####
### Monitors ###
## Variables
set $mcenter HDMI-A-1
set $mleft DP-1
#set $mright DPI-2
## Resolution and disposition
output $mleft res 1920x1080@60Hz pos 0 0
output $mcenter res 2560x1080@75Hz pos 1920 80
#adaptive_sync on max_render_time 1
#output $mright res 1920x1080@60Hz pos 4480 0
## Workspaces
workspace 1 output $mcenter
workspace 2 output $mleft
#workspace 3 output $mright
## First focused workspace
exec swaymsg focus output $mcenter
### Appearance ###
## Colors ##
# Start flavours
## Base16 Pasque
# Author: Gabriel Fontes (https://github.com/Misterio77)
set $base00 #271C3A
set $base01 #100323
set $base02 #3E2D5C
set $base03 #5D5766
set $base04 #BEBCBF
set $base05 #DEDCDF
set $base06 #EDEAEF
set $base07 #BBAADD
set $base08 #A92258
set $base09 #918889
set $base0A #804ead
set $base0B #C6914B
set $base0C #7263AA
set $base0D #8E7DC6
set $base0E #953B9D
set $base0F #59325C
# End flavours
client.focused $base02 $base00 $base05 $base00 $base00
client.unfocused $base02 $base00 $base04 $base00 $base00
client.focused_inactive $base02 $base00 $base04 $base00 $base00
client.urgent $base02 $base00 $base04 $base00 $base00
## Font ##
font pango:Fira Sans 12
# Gaps
gaps horizontal 5
#gaps inner 32
gaps inner 28
# Border
default_border pixel 2
for_window [class=".*"] border pixel 2
# Shadows and rounded borders
#border_images.focused ~/.config/sway/border-selected.png
#border_images.focused_inactive ~/.config/sway/border.png
#border_images.unfocused ~/.config/sway/border.png
#border_images.urgent ~/.config/sway/border.png
### Lock screen ###
# Initial lock
exec ~/.config/sway/swaylock.sh --image $(cat ~/.bg)
### Keys and binds ###
### Keyboard layout
input "6940:6985:Corsair_CORSAIR_K70_RGB_MK.2_Mechanical_Gaming_Keyboard" {
xkb_layout br
}
input "6940:6985:ckb1:_CORSAIR_K70_RGB_MK.2_Mechanical_Gaming_Keyboard_vKB" {
xkb_layout br
}
### Mouse sensitivity
input "6940:7051:ckb2:_CORSAIR_SCIMITAR_RGB_ELITE_Gaming_Mouse_vM" {
pointer_accel 1
}
## Keys definition ##
# Modifier keys
set $mod Mod4
set $alt Mod1
# Vim direction keys
set $left h
set $down j
set $up k
set $right l
# Profile key
set $profile XF86Tools
# Light key
set $light XF86Launch6
# Lock key
set $lock XF86Launch5
## Window manager keys ##
# Close containers
bindsym $alt+F4 kill
bindsym $mod+Shift+q kill
# Key for dragging floating windows around
floating_modifier $mod
# Focus containers
bindsym $mod+$left focus left
bindsym $mod+left focus left
bindsym $mod+$down focus down
bindsym $mod+down focus down
bindsym $mod+$up focus up
bindsym $mod+up focus up
bindsym $mod+$right focus right
bindsym $mod+right focus right
# Move containers
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+right move right
# Split orientation
bindsym $mod+minus split v
bindsym $mod+backslash split h
# Fullscreen focused container
bindsym $mod+f fullscreen toggle
# Change container layout (stacked, tabbed, toggle split)
bindsym $mod+Shift+t layout tabbed
bindsym $mod+Shift+s layout stacked
bindsym $mod+Shift+e layout toggle split
# Toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# Change focus between floating and tilled
bindsym $mod+space focus mode_toggle
# Focus the parent container
bindsym $mod+p focus parent
bindsym $mod+a focus parent
# Move entire workspace to another monitor
bindsym $mod+$alt+$left move workspace to output left
bindsym $mod+$alt+left move workspace to output left
bindsym $mod+$alt+$right move workspace to output right
bindsym $mod+$alt+right move workspace to output right
# Scratchpad
bindsym $mod+u scratchpad show
bindsym $mod+Shift+u move scratchpad
# Switch workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# Monitor toggles
bindsym $mod+control+left output $mleft toggle
bindsym $mod+control+down output $mcenter toggle
#bindsym $mod+control+right output $mright toggle
# Reload sway
bindsym $mod+Shift+r exec swaymsg reload
# Exit sway
bindsym $mod+Shift+x exec zenity --question --text="Do you really want to exit?" --no-wrap --icon-name=exit && swaymsg exit
# Resize mode
mode "resize" {
# Resize windows
bindsym $right resize shrink width 30 px or 10 ppt
bindsym right resize shrink width 30 px or 10 ppt
bindsym $down resize grow height 30 px or 10 ppt
bindsym down resize grow height 30 px or 10 ppt
bindsym $up resize shrink height 30 px or 10 ppt
bindsym up resize shrink height 30 px or 10 ppt
bindsym $left resize grow width 30 px or 10 ppt
bindsym left resize grow width 30 px or 10 ppt
# Move windows
bindsym Shift+$right move right 30
bindsym Shift+right move right 30
bindsym Shift+$down move down 30
bindsym Shift+down move down 30
bindsym Shift+$up move up 30
bindsym Shift+up move up 30
bindsym Shift+$left move left 30
bindsym Shift+left move left 30
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
## Media and volume ##
# Volume
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +1%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -1%
bindsym Shift+XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym Shift+XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym Shift+XF86AudioMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
# Media player controls
bindsym XF86AudioNext exec player=$(preferredplayer) && mpris-ctl next --player "$player" && pkill -SIGRTMIN+8 waybar
bindsym XF86AudioPrev exec player=$(preferredplayer) && mpris-ctl prev --player "$player" && pkill -SIGRTMIN+8 waybar
bindsym XF86AudioPlay exec player=$(preferredplayer) && mpris-ctl pp --player "$player" && pkill -SIGRTMIN+8 waybar
bindsym XF86AudioStop exec player=$(preferredplayer) && mpris-ctl stop --player "$player" && pkill -SIGRTMIN+8 waybar
bindsym Shift+XF86AudioPlay exec player=$(mpris-ctl list | alacritty-fzf) && preferredplayer "$player" && pkill -SIGRTMIN+8 waybar
bindsym Shift+XF86AudioStop exec preferredplayer none && pkill -SIGRTMIN+8 waybar
# Notifications
bindsym $mod+w exec makoctl dismiss
bindsym $mod+shift+w exec makoctl dismiss -a
bindsym $mod+control+w exec makoctl invoke
## Services keybinds ##
# Lock the screen
bindsym $lock exec ~/.config/sway/swaylock.sh --screenshots
# Toggle waybar visibility
bindsym Shift+$lock exec killall waybar -s USR1
# Change color scheme (flavours), using fzf alacritty
bindsym $light exec old="$(flavours current)" && \
flavours list -l | alacritty-fzf --preview='flavours apply -l {}' || \
flavours apply "${old}" && \
flavours apply "$(flavours current)"
# Change to random scheme
bindsym Shift+$light exec flavours apply
# Toggle dark/light mode
bindsym $alt+$light exec darkmode
# Change wallpaper (also updates scheme if current is generated), using fzf alacritty
bindsym $profile exec old="$(setwallpaper -Q)" && \
setwallpaper -L | alacritty-fzf --preview='setwallpaper {}' || \
setwallpaper "${old}" && \
setwallpaper "$(setwallpaper -Q)" && flavours apply "$(flavours current)"
# Change to random wallpaper
bindsym Shift+$profile exec setwallpaper -R
# Generates color scheme based on wallpaper and changes to it
bindsym $alt+$profile exec flavours generate $(darkmode q) $(cat ~/.bg) && \
flavours apply generated
# Toggle keyboard and mouse lights
bindsym control+$light exec systemctl --user is-active --quiet rgbdaemon && \
systemctl --user stop rgbdaemon || \
systemctl --user start rgbdaemon
# Get passwordstore password (or other item)
bindsym Scroll_Lock exec passfzf
# Reload gpg agent (remove cached password)
bindsym Shift+Scroll_Lock exec gpg-connect-agent reloadagent /bye && \
notify-send "Reloaded" "GPG Agent Reloaded successfully" -i lock -t 5000
# Mount pgp usb
bindsym $alt+Scroll_Lock exec mount ~/.pgp_usb && notify-send "Mounted" "Private pgp usb stick mounted" -i lock -t 5000
# Screenshot a monitor
bindsym --release Print exec geometry=$(slurp -ro) && grim -g "${geometry}" - | wl-copy && shutter_sound
bindsym --release Shift+Print exec geometry=$(slurp -ro) && sleep 4 && grim -g "${geometry}" - | wl-copy && shutter_sound
# Screenshot a window
bindsym --release $alt+Print exec geometry=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) && grim -g "${geometry}" - | wl-copy && shutter_sound
bindsym --release Shift+$alt+Print exec geometry=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) && sleep 4 && grim -g "${geometry}" - | wl-copy && shutter_sound
# Screenshot selection
bindsym --release $mod+Print exec geometry=$(slurp) && grim -g "${geometry}" - | wl-copy && shutter_sound
bindsym --release Shift+$mod+Print exec geometry=$(slurp) && sleep 4 && grim -g "${geometry}" - | wl-copy && shutter_sound
# Image clipboard upload
bindsym --release Ctrl+Print exec notify-send "Uploading" -i upload-media -t 3000 && \
link=$(wl-paste | imageupload) && \
wl-copy "$link" && \
notify-send "Upload successful" "$link" -i edit-copy -t 4000 || \
notify-send "Error" "No image received" -i error -t 6000
# Screencast
bindsym --release Pause exec systemctl --user is-active --quiet screencast && \
systemctl --user stop screencast || systemctl --user start screencast
## Launch app keys ##
# Open app menu
bindsym --release super_l exec rofimenu applications "舘" applications
bindsym --release super_r exec rofimenu applications "舘" applications
# Run dialog
bindsym $alt+F2 exec rofimenu run \> run
# Launch terminal
bindsym $mod+t exec alacritty
bindsym $mod+Return exec alacritty
# Launch terminal floating
bindsym $mod+Shift+Return exec alacritty --class AlacrittyFloating
# Launch browser
bindsym $mod+b exec qutebrowser
# Launch vim
bindsym $mod+v exec alacritty -e nvim
# Launch mutt
bindsym $mod+m exec alacritty -e neomutt
# Launch ikhal
bindsym $mod+c exec alacritty -e ikhal
# Launch zathura
bindsym $mod+z exec zathura
### Window overrides ###
## Scratchpad (hidden stuff) ##
# Origin
for_window [instance="origin.exe"] move scratchpad
for_window [title="Origin"] move scratchpad
for_window [title="Wine System Tray"] move scratchpad
## Floating ##
# Zenity
for_window [app_id="zenity"] floating enable
for_window [app_id="yad"] floating enable
# Gnome Calculator
for_window [app_id="gnome-calculator"] floating enable
# Steam
for_window [title="Friends List"] floating enable
for_window [title="Friends List"] [floating] resize set 300 600
# Discord updater
for_window [title="Discord Updater"] floating enable
# Alacritty floating
for_window [app_id="AlacrittyFloating*"] floating enable
for_window [app_id="AlacrittyFloatingMiner"] [floating] resize set 1000 300
for_window [app_id="AlacrittyFloatingSelector"] [floating] resize set 600 700
# Wrye Bash
for_window [instance="wrye bash.exe"] floating enable
# League of legends
for_window [instance="league of legends.exe"] floating enable
# Kde connect handler
for_window [app_id="org.kde.kdeconnect-urlhandler"] floating enable
# Firefox indicator
for_window [title="Firefox - Sharing indicator"] move scratchpad
### Startup programs ###
# wallpaper
exec ~/.config/sway/swaybg.sh
## Idle Manager
# 10 minutes -> lock the screen
# 10 seconds after locking -> mute inputs
# 20 seconds after locking -> turn off display, rgb lights, expire gpg agent session
exec swayidle -w \
timeout 600 '~/.config/sway/swaylock.sh --screenshots --daemonize' \
timeout 10 'pgrep -x swaylock && pactl set-source-mute @DEFAULT_SOURCE@ yes' \
resume 'pgrep -x swaylock && pactl set-source-mute @DEFAULT_SOURCE@ no' \
timeout 610 'pactl set-source-mute @DEFAULT_SOURCE@ yes' \
resume 'pactl set-source-mute @DEFAULT_SOURCE@ no' \
timeout 20 'pgrep -x swaylock && systemctl --user stop rgbdaemon' \
resume 'pgrep -x swaylock && systemctl --user start rgbdaemon' \
timeout 620 'systemctl --user stop rgbdaemon' \
resume 'systemctl --user start rgbdaemon' \
timeout 20 'pgrep -x swaylock && swaymsg "output * dpms off"' \
resume 'pgrep -x swaylock && swaymsg "output * dpms on"' \
timeout 620 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout 20 'pgrep -x swaylock && gpg-connect-agent reloadagent /bye' \
timeout 620 'gpg-connect-agent reloadagent /bye'
### Set either light or dark icon theme, depending on color scheme
exec_always seticons $(darkmode query)
### Kill gpg agent, so it can be restarted with the correct settings (ssh enabled)
exec gpg-connect-agent killagent /bye
### Set xwayland primary monitor
exec_always "xrandr --output $(xrandr | grep "XWAYLAND.*2560x1080" | awk '{printf $1}') --primary"
### Start systemd target and pass enviroment ###
exec "systemctl --user import-environment; systemctl --user start sway-session.target"