bea52591538a5b6222af2d62b55ab1e481e9b14e
[~bandali/configs] / .config / sway / config
1 ### Variables
2 # super
3 set $mod Mod4
4 # alt
5 set $mod2 Mod1
6 set $left h
7 set $down j
8 set $up k
9 set $right l
10 set $term urxvt
11 set $menu rofi -show run -display-run '> ' -display-window ' 🗔 '
12 set $pass rofi-pass
13
14 ### Output configuration
15 #
16 # Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)
17 #
18 # Example configuration:
19 #
20 # output HDMI-A-1 resolution 1920x1080 position 1920,0
21 #
22 # You can get the names of your outputs by running: swaymsg -t get_outputs
23
24 ### Input configuration
25
26 input "65261:24672:technomancy_Atreus" {
27 repeat_delay 200
28 repeat_rate 45
29 # xkb_options altwin:swap_alt_win
30 }
31
32 ### Idle configuration
33
34 exec swayidle \
35 timeout 120 '[ -f ~/.nosleep ] || swaymsg "output * dpms off"' \
36 resume '[ -f ~/.nosleep ] || swaymsg "output * dpms on"' \
37
38
39 ### Key bindings
40 #
41 # Basics:
42 #
43
44 set $floating_term $term -name floating
45 for_window [class="URxvt" instance="floating"] floating enable
46
47 set $mode_launch (⏎)urxvt | | (e)macs | (i)cecat/weasel
48 mode "$mode_launch" {
49 bindsym Return exec $floating_term, mode "default"
50 bindsym p exec $pass, mode "default"
51 bindsym e exec emacs, mode "default"
52
53 # back to normal: Escape, or q
54 bindsym Escape mode "default"
55 bindsym q mode "default"
56 }
57 bindsym $mod+tab mode "$mode_launch"
58 bindsym XF86Launch1 mode "$mode_launch"
59
60 # start a terminal
61 bindsym $mod+Return exec $term
62 bindsym $mod+Shift+Return exec $floating_term
63
64 # kill focused window
65 bindsym $mod+Shift+q kill
66
67 # start your launcher
68 bindsym $mod+space exec $menu
69
70 # start your launcher
71 bindsym $mod+Shift+space exec $pass
72
73 # Drag floating windows by holding down $mod and left mouse button.
74 # Resize them with right mouse button + $mod.
75 # Despite the name, also works for non-floating windows.
76 # Change normal to inverse to use left mouse button for resizing and right
77 # mouse button for dragging.
78 floating_modifier $mod normal
79
80 # reload the configuration file
81 bindsym $mod+Shift+c reload
82
83 # exit sway (logs you out of your wayland session)
84 # bindsym $mod+Shift+e exit
85
86 bindsym $mod+apostrophe exec rofi-light # rofi-based brightness chooser
87 bindsym XF86MonBrightnessUp exec light -A 5 # increase screen brightness
88 bindsym XF86MonBrightnessDown exec light -U 5 # decrease screen brightness
89
90 bindsym XF86AudioRaiseVolume exec pamixer --allow-boost --increase 5
91 bindsym XF86AudioLowerVolume exec pamixer --allow-boost --decrease 5
92 bindsym XF86AudioMute exec pamixer --toggle-mute
93 bindsym XF86AudioMicMute exec pactl set-source-mute 1 toggle
94
95 bindsym $mod+Shift+apostrophe exec rofi-remmina # choose remmina connection
96
97 # original sway workspace switch and window move
98 bindsym $mod+bracketleft workspace prev
99 bindsym $mod+bracketright workspace next
100 bindsym $mod+braceleft move container to workspace prev
101 bindsym $mod+braceright move container to workspace next
102
103 # bspwm-esque workspace switch and window move
104 bindsym $mod2+bracketleft exec sway-ws-util switch prev
105 bindsym $mod2+bracketright exec sway-ws-util switch next
106 bindsym $mod2+braceleft exec sway-ws-util move prev follow
107 bindsym $mod2+braceright exec sway-ws-util move next follow
108 #
109 # Moving around:
110 #
111 # Move your focus around
112 bindsym $mod+$left focus left
113 bindsym $mod+$down focus down
114 bindsym $mod+$up focus up
115 bindsym $mod+$right focus right
116 # or use $mod+[up|down|left|right]
117 bindsym $mod+Left focus left
118 bindsym $mod+Down focus down
119 bindsym $mod+Up focus up
120 bindsym $mod+Right focus right
121
122 # _move_ the focused window with the same, but add Shift
123 bindsym $mod+Shift+$left move left
124 bindsym $mod+Shift+$down move down
125 bindsym $mod+Shift+$up move up
126 bindsym $mod+Shift+$right move right
127 # ditto, with arrow keys
128 bindsym $mod+Shift+Left move left
129 bindsym $mod+Shift+Down move down
130 bindsym $mod+Shift+Up move up
131 bindsym $mod+Shift+Right move right
132 #
133 # Workspaces:
134 #
135 # switch to workspace
136 bindsym $mod+1 workspace 1
137 bindsym $mod+2 workspace 2
138 bindsym $mod+3 workspace 3
139 bindsym $mod+4 workspace 4
140 bindsym $mod+5 workspace 5
141 bindsym $mod+6 workspace 6
142 bindsym $mod+7 workspace 7
143 bindsym $mod+8 workspace 8
144 bindsym $mod+9 workspace 9
145 bindsym $mod+0 workspace 10
146 # move focused container to workspace
147 bindsym $mod+Shift+1 move container to workspace 1
148 bindsym $mod+Shift+2 move container to workspace 2
149 bindsym $mod+Shift+3 move container to workspace 3
150 bindsym $mod+Shift+4 move container to workspace 4
151 bindsym $mod+Shift+5 move container to workspace 5
152 bindsym $mod+Shift+6 move container to workspace 6
153 bindsym $mod+Shift+7 move container to workspace 7
154 bindsym $mod+Shift+8 move container to workspace 8
155 bindsym $mod+Shift+9 move container to workspace 9
156 bindsym $mod+Shift+0 move container to workspace 10
157 # Note: workspaces can have any name you want, not just numbers.
158 # We just use 1-10 as the default.
159 #
160 # Layout stuff:
161 #
162 # You can "split" the current object of your focus with
163 # $mod+b or $mod+v, for horizontal and vertical splits
164 # respectively.
165 bindsym $mod+b splith
166 bindsym $mod+v splitv
167
168 # Switch the current container between different layout styles
169 bindsym $mod+s layout stacking
170 bindsym $mod+w layout tabbed
171 bindsym $mod+e layout toggle split
172
173 # Make the current focus fullscreen
174 bindsym $mod+f fullscreen
175
176 # Toggle sticky-ness of the current (floating) window
177 bindsym $mod+Shift+s sticky toggle
178
179 # Toggle the current focus between tiling and floating mode
180 bindsym $mod+Shift+f floating toggle
181
182 # Swap focus between the tiling area and the floating area
183 bindsym $mod+grave focus mode_toggle
184
185 # move focus to the parent container
186 bindsym $mod+a focus parent
187 bindsym $mod+Shift+a focus child
188 #
189 # Scratchpad:
190 #
191 # Sway has a "scratchpad", which is a bag of holding for windows.
192 # You can send windows there and get them back later.
193
194 # Move the currently focused window to the scratchpad
195 bindsym $mod+Shift+minus move scratchpad
196
197 # Show the next scratchpad window or hide the focused scratchpad window.
198 # If there are multiple scratchpad windows, this command cycles through them.
199 bindsym $mod+minus scratchpad show
200 #
201 # Resizing containers:
202 #
203 mode "resize" {
204 # left will shrink the containers width
205 # right will grow the containers width
206 # up will shrink the containers height
207 # down will grow the containers height
208 bindsym $left resize shrink width 10px
209 bindsym $down resize grow height 10px
210 bindsym $up resize shrink height 10px
211 bindsym $right resize grow width 10px
212
213 # ditto, with arrow keys
214 bindsym Left resize shrink width 10px
215 bindsym Down resize grow height 10px
216 bindsym Up resize shrink height 10px
217 bindsym Right resize grow width 10px
218
219 # return to default mode
220 bindsym Return mode "default"
221 bindsym Escape mode "default"
222 }
223 bindsym $mod+Shift+r mode "resize"
224
225 #
226 # Power button
227 #
228
229 set $mode_system System (l)ock | (e)xit sway | (s)uspend | (h)ibernate | (r)eboot | (S)hutdown
230 mode "$mode_system" {
231 bindsym l exec swaylock, mode "default"
232 bindsym e exec swaymsg exit, mode "default"
233 bindsym s exec systemctl suspend, mode "default"
234 bindsym h exec systemctl hibernate, mode "default"
235 bindsym r exec systemctl reboot, mode "default"
236 bindsym Shift+s exec systemctl poweroff -i, mode "default"
237
238 # back to normal: Enter, Escape, or q
239 bindsym Return mode "default"
240 bindsym Escape mode "default"
241 bindsym q mode "default"
242 }
243 # bindsym XF86PowerOff mode "$mode_system"
244 bindsym $mod+Shift+e mode "$mode_system"
245 bindsym XF86ScreenSaver exec swaylock
246
247 #
248 # Presentation mode
249 #
250
251 bindsym $mod+$mod2+p exec ([ ! -e ~/.nosleep ] && touch ~/.nosleep || rm ~/.nosleep) && killall -USR1 i3status
252
253 #
254 # Notifications
255 #
256
257 bindsym $mod+Shift+n mode notifications
258 mode notifications {
259 bindsym Return exec makoctl invoke; exec makoctl dismiss; mode default
260 bindsym d exec makoctl dismiss; mode default
261 bindsym Shift+d exec makoctl dismiss -a; mode default
262
263 bindsym Escape mode default
264 bindsym q mode default
265 }
266
267 #
268 # Screenshotting
269 #
270
271 set $mode_screenshot (a)ll | (r)egion
272 mode "$mode_screenshot" {
273 bindsym a exec grim $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default
274 bindsym r exec grim -g "$(slurp)" $(xdg-user-dir PICTURES)/shots/$(date +'%Y-%m-%d-%H%M%S.png'); mode default
275
276 bindsym Escape mode default
277 bindsym q mode default
278 }
279 bindsym Print mode "$mode_screenshot"
280
281 #
282 # Window configurations
283 #
284 for_window [class="mpv"] floating enable
285 for_window [class="TelegramDesktop"] floating enable
286 for_window [app_id="pavucontrol"] floating enable
287 for_window [app_id="meld"] floating enable
288 for_window [app_id="nm-connection-editor"] floating enable
289
290 set $blue #285577
291 set $gray #1e1f21
292 set $red #900000
293
294 #
295 # Status Bar:
296 #
297 # Read `man 5 sway-bar` for more information about this section.
298 bar {
299 position bottom
300 colors {
301 background $gray
302 inactive_workspace $gray $gray #888888
303 active_workspace $gray $gray #ffffff
304 urgent_workspace $red $red #ffffff
305 focused_workspace $blue $blue #ffffff
306 }
307 status_command i3status | my-i3status
308 }
309
310 client.focused $blue $blue #ffffff $blue $blue
311 client.unfocused $gray $gray #ffffff $gray $gray
312 client.focused_inactive $gray $gray #ffffff $gray $gray
313
314 # font pango: DejaVu Sans Mono 9
315 font pango: Source Code Pro 9.5
316
317 # get rid of title bars
318 default_border pixel 4
319
320 exec xrdb .Xresources
321 # exec pgrep -x "systemd-inhibit" || \
322 # systemd-inhibit --what=handle-power-key --who=aminb \
323 # --why="Handle power button in sway" sleep infinity
324 exec mako 2>&1 >/tmp/mako.log
325 #exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
326
327 include /etc/sway/config.d/*
328 include ~/.config/sway/`hostname`
329
330 exec systemd-notify --ready || true