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