]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/sway/files/config.jinja
Configure tap to click
[max/saltfiles.git] / states / sway / files / config.jinja
1 {% set host = grains['host'] %}
2 # Colors
3 set $black #000000
4 set $black_super #555555
5
6 set $red #f92672
7 set $red_super #dd4278
8
9 set $green #74e22e
10 set $green_super #9dc54b
11
12 set $yellow #e6db74
13 set $yellow_super #d1ca89
14
15 set $blue #66d9ef
16 set $blue_super #7accda
17
18 set $magenta #ae81ff
19 set $magenta_super #b392ef
20
21 set $cyan #00d9d9
22 set $cyan_super #c8f0f0
23
24 set $white #f5deb3
25 set $white_super #ffffff
26
27 client.focused $black $yellow_super $black $black $black
28 client.focused_inactive $black $black_super $white $black $black 
29
30 # Slight gaps around windows
31 gaps inner 6
32
33 # Read `man 5 sway` for a complete reference.
34
35 ### Variables
36 #
37 # Logo key. Use Mod1 for Alt.
38 set $mod Mod4
39 # Home row direction keys, like vim
40 set $left h
41 set $down j
42 set $up k
43 set $right l
44 # Your preferred terminal emulator
45 set $term foot
46 # Your preferred application launcher
47 # Note: pass the final command to swaymsg so that the resulting window can be opened
48 # on the original workspace that the command was run on.
49 set $menu rofi -show drun | xargs swaymsg exec --
50
51 include /etc/sway/config-vars.d/*
52
53 ### Output configuration
54 #
55 # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
56 output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
57 #
58 # Example configuration:
59 #
60 #   output HDMI-A-1 resolution 1920x1080 position 1920,0
61 #
62 # You can get the names of your outputs by running: swaymsg -t get_outputs
63
64 ### Idle configuration
65 #
66 # Example configuration:
67 #
68 # exec swayidle -w \
69 #          timeout 300 'swaylock -f -c 000000' \
70 #          timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
71 #          before-sleep 'swaylock -f -c 000000'
72 #
73 # This will lock your screen after 300 seconds of inactivity, then turn off
74 # your displays after another 300 seconds, and turn your screens back on when
75 # resumed. It will also lock your screen before your computer goes to sleep.
76
77 {% set lockcmd = "swaylock -e -f -i ~/Pictures/Backgrounds/DSC02113.jpg" %}
78
79 exec swayidle -w \
80 timeout 300 "{{lockcmd}}" \
81   timeout 600 'systemctl suspend' \
82     before-sleep "{{lockcmd}}"
83
84
85 ### Input configuration
86 #
87 # Example configuration:
88 #
89 #   input "2:14:SynPS/2_Synaptics_TouchPad" {
90 #       dwt enabled
91 #       tap enabled
92 #       natural_scroll enabled
93 #       middle_emulation enabled
94 #   }
95 #
96 # You can get the names of your inputs by running: swaymsg -t get_inputs
97 # Read `man 5 sway-input` for more information about this section.
98 # This keyboard has this layout on all machines:
99 input 1267:12356:ELAN1200:00_04F3:3044_Touchpad {
100     dwt enabled
101     tap enabled
102     tap_button_map lmr
103     natural_scroll enabled
104 }
105
106 input 2362:597:UNIW0001:00_093A:0255_Touchpad {
107     dwt enabled
108     tap enabled
109     tap_button_map lmr
110     natural_scroll enabled
111 }
112
113 input 1241:36:HOLDCHIP_USB_Keyboard {
114   xkb_layout us
115   xkb_variant colemak
116   xkb_options ctrl:nocaps
117 }
118
119 input 16700:8455:DELL_Dell_USB_Entry_Keyboard {
120   xkb_layout gb
121   xkb_variant colemak
122   xkb_options ctrl:nocaps
123 }
124
125 input 65261:4871:TMK/Cub_Ergodox {
126   xkb_layout gb
127 }
128
129 input 9494:21:CM_Storm_Quickfire_Pro_Ultimate_6_key {
130   xkb_layout gb
131   xkb_variant colemak
132   xkb_options ctrl:nocaps
133 }
134
135 input 1:1:AT_Translated_Set_2_keyboard {
136   xkb_layout gb
137   xkb_variant colemak
138   xkb_options ctrl:nocaps
139 }
140
141 input 9610:4102:Gaming_KB__Gaming_KB {
142   xkb_layout gb
143   xkb_variant colemak
144   xkb_options ctrl:nocaps
145 }
146
147
148 input 1133:49948:Logitech_USB_Keyboard {
149   xkb_layout gb
150   xkb_variant colemak
151   xkb_options ctrl:nocaps
152 }
153
154 ### Key bindings
155 #
156 # Basics:
157 #
158     # Start a terminal
159     bindsym $mod+Return exec $term
160
161     # Kill focused window
162     bindsym $mod+Shift+q kill
163
164     # Start your launcher
165     bindsym $mod+d exec $menu
166
167     # Drag floating windows by holding down $mod and left mouse button.
168     # Resize them with right mouse button + $mod.
169     # Despite the name, also works for non-floating windows.
170     # Change normal to inverse to use left mouse button for resizing and right
171     # mouse button for dragging.
172     floating_modifier $mod normal
173
174     # Reload the configuration file
175     bindsym $mod+Shift+c reload
176
177     # Exit sway (logs you out of your Wayland session)
178     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'
179 #
180 # Moving around:
181 #
182     # Move your focus around
183     bindsym $mod+$left focus left
184     bindsym $mod+$down focus down
185     bindsym $mod+$up focus up
186     bindsym $mod+$right focus right
187     # Or use $mod+[up|down|left|right]
188     bindsym $mod+Left focus left
189     bindsym $mod+Down focus down
190     bindsym $mod+Up focus up
191     bindsym $mod+Right focus right
192
193     # Move the focused window with the same, but add Shift
194     bindsym $mod+Shift+$left move left
195     bindsym $mod+Shift+$down move down
196     bindsym $mod+Shift+$up move up
197     bindsym $mod+Shift+$right move right
198     # Ditto, with arrow keys
199     bindsym $mod+Shift+Left move left
200     bindsym $mod+Shift+Down move down
201     bindsym $mod+Shift+Up move up
202     bindsym $mod+Shift+Right move right
203 #
204 # Workspaces:
205 #
206     # Switch to workspace
207     {% for i in range(10) %}
208         bindsym $mod+{{ i }} workspace number {{ i }}
209
210         # Move focused container to workspace
211         bindsym $mod+Shift+{{ i }} move container to workspace number {{ i }}
212     {% endfor %}
213
214 #
215 # Layout stuff:
216 #
217     # You can "split" the current object of your focus with
218     # $mod+b or $mod+v, for horizontal and vertical splits
219     # respectively.
220     bindsym $mod+b splith
221     bindsym $mod+v splitv
222
223     # Switch the current container between different layout styles
224     bindsym $mod+s layout stacking
225     bindsym $mod+w layout tabbed
226     bindsym $mod+e layout toggle split
227
228     # Make the current focus fullscreen
229     bindsym $mod+f fullscreen
230
231     # Toggle the current focus between tiling and floating mode
232     bindsym $mod+Shift+space floating toggle
233
234     # Swap focus between the tiling area and the floating area
235     bindsym $mod+space focus mode_toggle
236
237     # Move focus to the parent container
238     bindsym $mod+a focus parent
239 #
240 # Scratchpad:
241 #
242     # Sway has a "scratchpad", which is a bag of holding for windows.
243     # You can send windows there and get them back later.
244
245     # Move the currently focused window to the scratchpad
246     bindsym $mod+Shift+minus move scratchpad
247
248     # Show the next scratchpad window or hide the focused scratchpad window.
249     # If there are multiple scratchpad windows, this command cycles through them.
250     bindsym $mod+minus scratchpad show
251 #
252 # Resizing containers:
253 #
254 mode "resize" {
255     # left will shrink the containers width
256     # right will grow the containers width
257     # up will shrink the containers height
258     # down will grow the containers height
259     bindsym $left resize shrink width 10px
260     bindsym $down resize grow height 10px
261     bindsym $up resize shrink height 10px
262     bindsym $right resize grow width 10px
263
264     # Ditto, with arrow keys
265     bindsym Left resize shrink width 10px
266     bindsym Down resize grow height 10px
267     bindsym Up resize shrink height 10px
268     bindsym Right resize grow width 10px
269
270     # Return to default mode
271     bindsym Return mode "default"
272     bindsym Escape mode "default"
273 }
274 bindsym $mod+r mode "resize"
275
276 bindsym $mod+Alt+l exec '{{ lockcmd }}'
277
278
279 include /etc/sway/config.d/*
280 # host specific section
281 {%- do salt.log.error('sway/files/' + host) -%}
282
283 {% include 'sway/files/' + host %}
284
285 for_window [app_id="zoom" title="^zoom$"] border none, floating enable
286 for_window [app_id="zoom" title="^(Zoom|About)$"] border pixel, floating enable
287 for_window [app_id="zoom" title="Settings"] floating enable, floating_minimum_size 960 x 700
288 for_window [app_id="zoom" title="Zoom Meeting(.*)?"] floating disable, inhibit_idle open