~yerinalexey/dotfiles

ref: b75055cfb2820b41efd348481e49a2f487355931 dotfiles/sway/config -rw-r--r-- 6.8 KiB
b75055cf — Alexey Yerin bottom: fix indents 1 year, 2 months ago
                                                                                
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
### Variables
# Logo key. Use Mod1 for Alt.
set $mod Mod4

# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l

# Your preferred terminal emulator
set $term alacritty

# Your preferred web browser
set $browser firefox

# Your preferred application launcher:
set $menu bemenu-run \
  --fn "monospace 12" \
  -p "Run: " \
  -i --no-exec | xargs swaymsg exec --

# Uncomment to use dmenu
# set $menu dmenu_path | dmenu | xargs swaymsg exec --

### Output configuration
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
# output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
output * bg ~/.config/wall.jpg fill

### Idle configuration
exec swayidle \
  timeout 480 'waylock' \
  timeout 1200 'swaymsg "output * dpms off"' \
  resume 'swaymsg "output * dpms on"' \
  before-sleep 'waylock'

# This will lock your screen after 8 minutes of inactivity, then turn off your
# displays after 12 minutes (20 in total), and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.

### Input configuration
# Keyboard settings
input type:keyboard {
  # English and Russian layouts
  xkb_layout us,ru

  # NumLock is always on
  xkb_numlock on

  # Switch layouts with Alt+Shift
  xkb_options grp:alt_shift_toggle
}

### Appearance
# Gaps
gaps inner 4
gaps outer 0

# Disable window decorations
default_border pixel 2

# Disable borders and gaps when there's only a single window on the screen
smart_gaps enable
smart_borders enable

### Colors
# Palette
set $urgent #bf7070
set $focus #abb2bf
set $focus_indicator #313c52
set $inactive #2c323c
set $inactive_indicator $inactive
set $text #ffffff
set $text_dark #222222

# Focused windows
client.focused $focus $focus $text_dark $focus_indicator

# Inactive windows
client.focused_inactive $inactive $inactive $text $inactive_indicator
client.unfocused $inactive $inactive $text $inactive_indicator

# Urgent windows
client.urgent $urgent $urgent $text

### Rules
# Open calculator as floating window
for_window [app_id="gnome-calculator"] floating enable

# Open dialogs and popups as floating windows
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="dialog"] floating enable
for_window [window_type="dialog"] floating enable

# Some tweaks for picture-in-picture windows
for_window [window_role="PictureInPicture"] border none, sticky enable

# Immediately focus window when it requests focus
focus_on_window_activation focus

### Key bindings
# Open a terminal
bindsym $mod+Return exec $term

# Open a web browser
bindsym $mod+w exec $browser

# Open an application launcher
bindsym $mod+d exec $menu

# Reload the configuration file
bindsym $mod+Shift+c reload

# Open exit menu
bindsym $mod+Shift+q exec nwgbar

# Open emoji chooser
bindsym $mod+comma exec emoji-chooser

# Dismiss all notifications
bindsym $mod+Shift+d exec makoctl dismiss -a

# Open volume controls
bindsym $mod+Shift+v exec $term -e pulsemixer

# Open E-mail
bindsym $mod+m exec $term -e neomutt

# Open calculator
bindsym $mod+c exec gnome-calculator

# Copy password
bindsym $mod+period exec pass-menu

## Window management
# Kill focused window
bindsym $mod+q kill

# Change direction for new windows
bindsym $mod+v split toggle

# Toggle fullscreen mode
bindsym $mod+f fullscreen

# Drag floating (and also normal) windows with Super + Left click, Super + Right click to resize
floating_modifier $mod normal

# Toggle between normal and floating modes
bindsym $mod+Shift+Space floating toggle

# Cycle between focus layers (normal or floating)
bindsym $mod+Space focus mode_toggle

# Focus parent and child containers
bindsym $mod+a focus parent
bindsym $mod+shift+a focus child

## Screenshots
# Take screenshot of an entire screen
bindsym $mod+p exec screenshot

# Take screenshot of an area and copy it to clipboard
bindsym $mod+Control+p exec area-screenshot

# Take a screenshot of window
bindsym $mod+Shift+p exec window-screenshot

# Pick a color
bindsym $mod+Alt+p exec pick-color

# Quickly edit a screenshot, requires swappy (https://github.com/jtheoof/swappy)
bindsym $mod+s exec swappy-last

## Music & volume controls
# Switch player
bindsym $mod+F9 exec player-menu

# Play/pause
bindsym $mod+F11 exec playerctl-mod play-pause

# Cycle between tracks
bindsym $mod+F10 exec playerctl-mod previous
bindsym $mod+F12 exec playerctl-mod next

# Volume controls
bindsym $mod+F8 exec pulsemixer --change-volume +5
bindsym $mod+F7 exec pulsemixer --change-volume -5

## Moving around:
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right

# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right

## Workspaces:
# Switch to 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
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.

# Cycle between workspaces
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev

## Scratchpad:
# Move the currently focused window to the scratchpad
bindsym $mod+minus move scratchpad

# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+equal scratchpad show

## Resizing containers:
bindsym $mod+Alt+$left resize grow width 10px
bindsym $mod+Alt+$down resize shrink height 10px
bindsym $mod+Alt+$up resize grow height 10px
bindsym $mod+Alt+$right resize shrink width 10px

### Status Bar:
# Read `man 5 sway-bar` for more information about this section.
bar {
  position top

  # Launch waybar instead of default bar
  swaybar_command waybar

  colors {
    statusline #ffffff
    background #323232
    inactive_workspace #323232ff #323232ff #5c5c5c
  }
}

include ~/.config/sway/config.d/*

# Launch mako (if dbus activation don't work)
exec mako

# Launch mpd
exec mpd
exec mpDris2 &>/dev/null