source: dotfiles/guix/.config/sway/config@ 6f739ce

Last change on this file since 6f739ce was 9989e84, checked in by Mikhail Kirillov <w96k@…>, on Apr 13, 2020 at 7:41:10 PM

Update everything

  • Property mode set to 100644
File size: 8.4 KB
Line 
1# Default config for sway
2#
3# Copy this to ~/.config/sway/config and edit it to your liking.
4#
5# Read `man 5 sway` for a complete reference.
6
7### Variables
8#
9# Logo key. Use Mod1 for Alt.
10set $mod Mod4
11# Home row direction keys, like vim
12set $left h
13set $down j
14set $up k
15set $right l
16
17set $term wterm
18
19bindsym $mod+d exec --no-startup-id "rofi -show drun -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
20bindsym $mod+w exec --no-startup-id "rofi -show window -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
21
22exec dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus
23exec mako
24
25# exec swayidle -w \
26# timeout 300 'swaylock -f -c 000000' \
27# timeout 600 'swaymsg "output * dpms off"' \
28# resume 'swaymsg "output * dpms on"' \
29# before-sleep 'swaylock -f -c 000000'
30
31### Key bindings
32#
33# Basics:
34#
35 # Start a terminal
36 bindsym $mod+Return exec $term
37 bindsym $mod+c exec $term
38
39
40 # Kill focused window
41 bindsym $mod+q kill
42
43
44 # Drag floating windows by holding down $mod and left mouse button.
45 # Resize them with right mouse button + $mod.
46 # Despite the name, also works for non-floating windows.
47 # Change normal to inverse to use left mouse button for resizing and right
48 # mouse button for dragging.
49 floating_modifier $mod normal
50
51 # Reload the configuration file
52 bindsym $mod+Shift+c reload
53
54 # Exit sway (logs you out of your Wayland session)
55 bindsym $mod+Shift+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'
56#
57# Moving around:
58#
59 # Move your focus around
60 bindsym $mod+$left focus left
61 bindsym $mod+$down focus down
62 bindsym $mod+$up focus up
63 bindsym $mod+$right focus right
64 # Or use $mod+[up|down|left|right]
65 bindsym $mod+Left focus left
66 bindsym $mod+Down focus down
67 bindsym $mod+Up focus up
68 bindsym $mod+Right focus right
69
70 # Move the focused window with the same, but add Shift
71 bindsym $mod+Shift+$left move left
72 bindsym $mod+Shift+$down move down
73 bindsym $mod+Shift+$up move up
74 bindsym $mod+Shift+$right move right
75 # Ditto, with arrow keys
76 bindsym $mod+Shift+Left move left
77 bindsym $mod+Shift+Down move down
78 bindsym $mod+Shift+Up move up
79 bindsym $mod+Shift+Right move right
80#
81# Workspaces:
82#
83 # Switch to workspace
84 bindsym $mod+1 workspace 1
85 bindsym $mod+2 workspace 2
86 bindsym $mod+3 workspace 3
87 bindsym $mod+4 workspace 4
88 bindsym $mod+5 workspace 5
89 bindsym $mod+6 workspace 6
90 bindsym $mod+7 workspace 7
91 bindsym $mod+8 workspace 8
92 bindsym $mod+9 workspace 9
93 bindsym $mod+0 workspace 10
94 # Move focused container to workspace
95 bindsym $mod+Shift+1 move container to workspace 1
96 bindsym $mod+Shift+2 move container to workspace 2
97 bindsym $mod+Shift+3 move container to workspace 3
98 bindsym $mod+Shift+4 move container to workspace 4
99 bindsym $mod+Shift+5 move container to workspace 5
100 bindsym $mod+Shift+6 move container to workspace 6
101 bindsym $mod+Shift+7 move container to workspace 7
102 bindsym $mod+Shift+8 move container to workspace 8
103 bindsym $mod+Shift+9 move container to workspace 9
104 bindsym $mod+Shift+0 move container to workspace 10
105 # Note: workspaces can have any name you want, not just numbers.
106 # We just use 1-10 as the default.
107#
108# Layout stuff:
109#
110 # You can "split" the current object of your focus with
111 # $mod+b or $mod+v, for horizontal and vertical splits
112 # respectively.
113 bindsym $mod+b splith
114 bindsym $mod+v splitv
115
116 # Switch the current container between different layout styles
117 bindsym $mod+s layout stacking
118 #bindsym $mod+w layout tabbed
119
120 # Make the current focus fullscreen
121 bindsym $mod+f fullscreen
122
123 # Toggle the current focus between tiling and floating mode
124 bindsym $mod+Shift+space floating toggle
125
126 # Swap focus between the tiling area and the floating area
127 bindsym $mod+space focus mode_toggle
128
129 # Move focus to the parent container
130 bindsym $mod+a focus parent
131#
132# Scratchpad:
133#
134 # Sway has a "scratchpad", which is a bag of holding for windows.
135 # You can send windows there and get them back later.
136
137 # Move the currently focused window to the scratchpad
138 bindsym $mod+Shift+minus move scratchpad
139
140 # Show the next scratchpad window or hide the focused scratchpad window.
141 # If there are multiple scratchpad windows, this command cycles through them.
142 bindsym $mod+minus scratchpad show
143#
144# Resizing containers:
145#
146mode "resize" {
147 # left will shrink the containers width
148 # right will grow the containers width
149 # up will shrink the containers height
150 # down will grow the containers height
151 bindsym $left resize shrink width 10px
152 bindsym $down resize grow height 10px
153 bindsym $up resize shrink height 10px
154 bindsym $right resize grow width 10px
155
156 # Ditto, with arrow keys
157 bindsym Left resize shrink width 10px
158 bindsym Down resize grow height 10px
159 bindsym Up resize shrink height 10px
160 bindsym Right resize grow width 10px
161
162 # Return to default mode
163 bindsym Return mode "default"
164 bindsym Escape mode "default"
165}
166bindsym $mod+r mode "resize"
167
168# Volume control
169bindsym XF86AudioRaiseVolume exec amixer -q sset Master 5%+
170bindsym XF86AudioLowerVolume exec amixer -q sset Master 5%-
171bindsym XF86AudioMute exec amixer -q sset Master toggle
172
173bar {
174 position top
175
176 #status_command SCRIPT_DIR=~/.config/i3blocks/ i3blocks
177
178 strip_workspace_name yes
179
180 #tray_output primary
181
182 colors {
183 statusline #cccccc
184 background #333333
185 focused_workspace #333333 #aeafad #333333
186 inactive_workspace #333333 #333333 #cccccc
187 urgent_workspace #333333 #f2777a #2d2d2d
188 }
189}
190
191
192input type:keyboard {
193 xkb_layout us,ru
194 xkb_options grp:win_space_toggle,caps:ctrl_modifier#,ctrl:nocaps
195}
196
197# Change borders
198default_border none
199default_floating_border normal
200hide_edge_borders vertical
201
202gaps inner 1
203
204workspace_auto_back_and_forth on
205focus_on_window_activation focus
206focus_wrapping workspace
207
208# Default stumpwm keybinding doesn't work, because C-t is used by many programs
209# and sway let other programs to use binded keys.
210set $StumpMod Control+t
211
212assign [class="Emacs"] "Editor"
213assign [class="Icecat"] "Browser"
214assign [class="Firefox"] "Browser"
215assign [class="Chromium"] "Browser"
216
217mode "stumpwm" {
218 # Would be nice to have exit from mode after each bind
219
220 bindsym --to-code {
221 # Launch emacs
222 e exec emacsclient; workspace "Editor"; mode default;
223
224 shift+e exec "if ps auxf | grep -c emacs > 1; then swaymsg '[class=Emacs] focus'; else swaymsg exec 'emacs'; fi; swaymsg 'mode default'";
225
226 # Launch terminal
227 c mode default; exec $term;
228
229 # Kill window
230 k kill; mode default;
231
232 # Navigation
233 n workspace next; mode default;
234 p workspace prev; mode default;
235
236 # Switch to previous workspace
237 t workspace current; mode default;
238 Control+t workspace current; mode default;
239
240 # Splitting
241 s split vertical; mode default;
242 Shift+s split horizontal; mode default;
243
244 # Exit stumpwmm mode
245 g mode default;
246
247 Control+g mode default;
248
249 # Select workspace with corresponding digit
250 0 workspace "0: Emacs"; mode default;
251 1 workspace 1; mode default;
252 2 workspace 2; mode default;
253 3 workspace 3; mode default;
254 4 workspace 4; mode default;
255 5 workspace 5; mode default;
256 6 workspace 6; mode default;
257 7 workspace 7; mode default;
258 8 workspace 8; mode default;
259 9 workspace 9; mode default;
260
261 # Choose/find window
262 apostrophe exec --no-startup-id "swaymsg mode default; rofi -show window"
263
264 # Combimode
265 b exec --no-startup-id "swaymsg mode default; rofi -show combi"
266
267
268 # Exec/find shell command
269 shift+1 exec --no-startup-id "swaymsg mode default; rofi -show run -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
270 }
271
272 # bindsym --to-code n exec "swaymsg focus down; swaymsg mode default;"
273 # bindsym --to-code p exec "swaymsg focus up; swaymsg mode default;"
274 # bindsym --to-code b exec "swaymsg focus left; swaymsg mode default;"
275 # bindsym --to-code f exec "swaymsg focus right; swaymsg mode default;"
276
277 # List of windows
278 bindsym w exec --no-startup-id "swaymsg mode default; rofi -show window -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
279}
280bindsym --to-code $StumpMod mode "stumpwm"
281
282bindsym --to-code $mod+n exec --no-startup-id "rofi -show window"
283
284bindsym $mod+g mode "default"
Note: See TracBrowser for help on using the repository browser.