blob: 15e5df32282d44e78d2b33bef90057ae8f44046f (
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
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
|
#+title: Sway Configuration
* Variables
Use =super= as modifier key.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
set $mod Mod4
#+end_src
Use =vi= motions as directional inputs.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
set $left h
set $down j
set $up k
set $right l
#+end_src
Use =foot= as default terminal.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
set $term foot
#+end_src
Use =wofi= as app launcher.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
set $menu fuzzel
#+end_src
* Startup Application
Use =dbus= environment.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec --no-startup-id dbus-update-activation-environment --all
#+end_src
Use =mako= as notification daemon.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec mako
#+end_src
Launch PipeWire without =systemd=.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec gentoo-pipewire-launcher restart &
#+end_src
Launch =blueman-applet= as Bluetooth daemon.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec blueman-applet
#+end_src
Launch music player daemon.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec mpd
#+end_src
Launch =mpdscribble= as scrobbler daemon.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec mpdscribble
#+end_src
Launch Emacs daemon.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec emacs --daemon
#+end_src
Launch Proton Mail Bridge at login.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec proton-mail-bridge --noninteractive
#+end_src
Launch Syncthing at login.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
exec syncthing
#+end_src
* Display
I use a vertical monitor on the left and horizontal monitor on the right.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
output DP-2 resolution 2560x1440 position 1080 100
output HDMI-A-2 resolution 1920x1080 transform 90 position 0 0
#+end_src
Use the file at =~/.wallpaper= as my wallpaper.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
output * bg ~/.wallpaper fill
#+end_src
Remove borders from windows.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
default_border none
default_floating_border none
font pango:monospace 1
#+end_src
Use 10 pixel gaps.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
gaps inner 10
#+end_src
Use =waybar= as a top bar.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bar {
position top
status_command waybar
mode invisible
}
#+end_src
* Input
Use pointer acceleration.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
input * {
accel_profile "adaptive"
pointer_accel -.5
}
#+end_src
* Controls
Add ability to lock the screen with =swaylock=. Turn off the screen after 15 seconds on lock screen.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Control+l exec swaylock --ignore-empty-password --show-failed-attempts --image ~/.wallpaper
exec swayidle -w timeout 15 'if pgrep -x swaylock; then swaymsg "output * power off"; fi' resume 'swaymsg "output * power on"'
#+end_src
Add keybinding to open a terminal emulator.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Return exec $term
#+end_src
Add keybinding for killing a window.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+q kill
#+end_src
Add keybinding for opening an app launcher.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+d exec $menu
#+end_src
Holding the modifier key allows moving a window.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
floating_modifier $mod normal
#+end_src
Add keybinding for reloading the configuration.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+c reload
#+end_src
Add keybinding to launch logout/power off/restart [[file:powerprompt.org][prompt]] which also activates with the power key.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+e exec bash ~/.config/sway/powerprompt
bindsym XF86PowerOff exec bash ~/.config/sway/powerprompt
#+end_src
Change focus keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
#+end_src
Move window keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#+end_src
Change workspace keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
#+end_src
Move window to workspace keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
#+end_src
Set split direction keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+v splith
bindsym $mod+s splitv
#+end_src
Toggle layout keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+e layout toggle split
#+end_src
Define full screen keybinding.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+f fullscreen
#+end_src
Define toggle floating keybinding.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+space floating toggle
#+end_src
Move focus between floating and tiled layer keybinding.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+space focus mode_toggle
#+end_src
Focus on the parent window keybinding.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+a focus parent
#+end_src
Keybindings to move a window to the scratchpad and back from it.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
#+end_src
Add resize keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
mode "resize" {
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#+end_src
Add screenshot keybinding.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy
#+end_src
Add volume keybindings.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
#+end_src
Add pause keybinding.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
bindsym XF86Eject exec mpc toggle
#+end_src
* Extras
Load extra configuration.
#+begin_src conf :tangle ~/.config/sway/config :mkdirp yes
include /etc/sway/config.d/*
#+end_src
|