]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/sway/files/config.jinja
Omg
[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 kitty
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 dmenu_path | wofi --dmenu | 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 ### Input configuration
78 #
79 # Example configuration:
80 #
81 #   input "2:14:SynPS/2_Synaptics_TouchPad" {
82 #       dwt enabled
83 #       tap enabled
84 #       natural_scroll enabled
85 #       middle_emulation enabled
86 #   }
87 #
88 # You can get the names of your inputs by running: swaymsg -t get_inputs
89 # Read `man 5 sway-input` for more information about this section.
90 # This keyboard has this layout on all machines:
91 input 1241:36:HOLDCHIP_USB_Keyboard {
92   xkb_layout us
93   xkb_variant colemak
94   xkb_options ctrl:nocaps
95 }
96
97 input 16700:8455:DELL_Dell_USB_Entry_Keyboard {
98   xkb_layout gb
99   xkb_variant colemak
100   xkb_options ctrl:nocaps
101 }
102
103 input 65261:4871:TMK/Cub_Ergodox {
104   xkb_layout gb
105 }
106
107 input 9494:21:CM_Storm_Quickfire_Pro_Ultimate_6_key {
108   xkb_layout gb
109   xkb_variant colemak
110   xkb_options ctrl:nocaps
111 }
112
113 input 1:1:AT_Translated_Set_2_keyboard {
114   xkb_layout gb
115   xkb_variant colemak
116   xkb_options ctrl:nocaps
117 }
118
119 input 9610:4102:Gaming_KB__Gaming_KB {
120   xkb_layout gb
121   xkb_variant colemak
122   xkb_options ctrl:nocaps
123 }
124
125 ### Key bindings
126 #
127 # Basics:
128 #
129     # Start a terminal
130     bindsym $mod+Return exec $term
131
132     # Kill focused window
133     bindsym $mod+Shift+q kill
134
135     # Start your launcher
136     bindsym $mod+d exec $menu
137
138     # Drag floating windows by holding down $mod and left mouse button.
139     # Resize them with right mouse button + $mod.
140     # Despite the name, also works for non-floating windows.
141     # Change normal to inverse to use left mouse button for resizing and right
142     # mouse button for dragging.
143     floating_modifier $mod normal
144
145     # Reload the configuration file
146     bindsym $mod+Shift+c reload
147
148     # Exit sway (logs you out of your Wayland session)
149     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'
150 #
151 # Moving around:
152 #
153     # Move your focus around
154     bindsym $mod+$left focus left
155     bindsym $mod+$down focus down
156     bindsym $mod+$up focus up
157     bindsym $mod+$right focus right
158     # Or use $mod+[up|down|left|right]
159     bindsym $mod+Left focus left
160     bindsym $mod+Down focus down
161     bindsym $mod+Up focus up
162     bindsym $mod+Right focus right
163
164     # Move the focused window with the same, but add Shift
165     bindsym $mod+Shift+$left move left
166     bindsym $mod+Shift+$down move down
167     bindsym $mod+Shift+$up move up
168     bindsym $mod+Shift+$right move right
169     # Ditto, with arrow keys
170     bindsym $mod+Shift+Left move left
171     bindsym $mod+Shift+Down move down
172     bindsym $mod+Shift+Up move up
173     bindsym $mod+Shift+Right move right
174 #
175 # Workspaces:
176 #
177     # Switch to workspace
178     bindsym $mod+1 workspace number 1
179     bindsym $mod+2 workspace number 2
180     bindsym $mod+3 workspace number 3
181     bindsym $mod+4 workspace number 4
182     bindsym $mod+5 workspace number 5
183     bindsym $mod+6 workspace number 6
184     bindsym $mod+7 workspace number 7
185     bindsym $mod+8 workspace number 8
186     bindsym $mod+9 workspace number 9
187     bindsym $mod+0 workspace number 10
188     # Move focused container to workspace
189     bindsym $mod+Shift+1 move container to workspace number 1
190     bindsym $mod+Shift+2 move container to workspace number 2
191     bindsym $mod+Shift+3 move container to workspace number 3
192     bindsym $mod+Shift+4 move container to workspace number 4
193     bindsym $mod+Shift+5 move container to workspace number 5
194     bindsym $mod+Shift+6 move container to workspace number 6
195     bindsym $mod+Shift+7 move container to workspace number 7
196     bindsym $mod+Shift+8 move container to workspace number 8
197     bindsym $mod+Shift+9 move container to workspace number 9
198     bindsym $mod+Shift+0 move container to workspace number 10
199     # Note: workspaces can have any name you want, not just numbers.
200     # We just use 1-10 as the default.
201 #
202 # Layout stuff:
203 #
204     # You can "split" the current object of your focus with
205     # $mod+b or $mod+v, for horizontal and vertical splits
206     # respectively.
207     bindsym $mod+b splith
208     bindsym $mod+v splitv
209
210     # Switch the current container between different layout styles
211     bindsym $mod+s layout stacking
212     bindsym $mod+w layout tabbed
213     bindsym $mod+e layout toggle split
214
215     # Make the current focus fullscreen
216     bindsym $mod+f fullscreen
217
218     # Toggle the current focus between tiling and floating mode
219     bindsym $mod+Shift+space floating toggle
220
221     # Swap focus between the tiling area and the floating area
222     bindsym $mod+space focus mode_toggle
223
224     # Move focus to the parent container
225     bindsym $mod+a focus parent
226 #
227 # Scratchpad:
228 #
229     # Sway has a "scratchpad", which is a bag of holding for windows.
230     # You can send windows there and get them back later.
231
232     # Move the currently focused window to the scratchpad
233     bindsym $mod+Shift+minus move scratchpad
234
235     # Show the next scratchpad window or hide the focused scratchpad window.
236     # If there are multiple scratchpad windows, this command cycles through them.
237     bindsym $mod+minus scratchpad show
238 #
239 # Resizing containers:
240 #
241 mode "resize" {
242     # left will shrink the containers width
243     # right will grow the containers width
244     # up will shrink the containers height
245     # down will grow the containers height
246     bindsym $left resize shrink width 10px
247     bindsym $down resize grow height 10px
248     bindsym $up resize shrink height 10px
249     bindsym $right resize grow width 10px
250
251     # Ditto, with arrow keys
252     bindsym Left resize shrink width 10px
253     bindsym Down resize grow height 10px
254     bindsym Up resize shrink height 10px
255     bindsym Right resize grow width 10px
256
257     # Return to default mode
258     bindsym Return mode "default"
259     bindsym Escape mode "default"
260 }
261 bindsym $mod+r mode "resize"
262
263
264 include /etc/sway/config.d/*
265 # host specific section
266 {%- do salt.log.error('sway/files/' + host) -%}
267 {% include 'sway/files/' + host %}