]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/i3/files/config.jinja
Omg
[max/saltfiles.git] / states / i3 / files / config.jinja
1 {% set host = grains['host'] %}
2
3 # Colors
4 set $black #000000
5 set $black_super #555555
6
7 set $red #f92672
8 set $red_super #dd4278
9
10 set $green #74e22e
11 set $green_super #9dc54b
12
13 set $yellow #e6db74
14 set $yellow_super #d1ca89
15
16 set $blue #66d9ef
17 set $blue_super #7accda
18
19 set $magenta #ae81ff
20 set $magenta_super #b392ef
21
22 set $cyan #00d9d9
23 set $cyan_super #c8f0f0
24
25 set $white #f5deb3
26 set $white_super #ffffff
27
28 client.focused $black $yellow_super $black $black $black
29 client.focused_inactive $black $black_super $white $black $black 
30
31 set $mod Mod4
32
33 # Font for window titles. Will also be used by the bar unless a different font
34 # is used in the bar {} block below.
35 font pango:monospace 10
36
37 # This font is widely installed, provides lots of unicode glyphs, right-to-left
38 # text rendering and scalability on retina/hidpi displays (thanks to pango).
39 #font pango:DejaVu Sans Mono 8
40
41 # The combination of xss-lock, nm-applet and pactl is a popular choice, so
42 # they are included here as an example. Modify as you see fit.
43
44 exec xset dpms 600 900 0
45 # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
46 # screen before suspend. Use loginctl lock-session to lock your screen.
47 exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -i ~/Pictures/lockscreen_full_blurred_1.png --nofork
48
49 # NetworkManager is the most popular way to manage wireless networks on Linux,
50 # and nm-applet is a desktop environment-independent system tray GUI for it.
51 exec --no-startup-id nm-applet
52
53 bindsym $mod+Shift+l exec systemctl suspend
54
55 # Use pactl to adjust volume in PulseAudio.
56 set $refresh_i3status killall -SIGUSR1 i3status
57 bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
58 bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
59 bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
60 bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
61
62 # Use Mouse+$mod to drag floating windows to their wanted position
63 floating_modifier $mod
64
65 # start a terminal
66 bindsym $mod+Return exec i3-sensible-terminal
67
68 # kill focused window
69 bindsym $mod+Shift+q kill
70
71 # start dmenu (a program launcher)
72 bindsym $mod+s exec "rofi -modi drun,run -show drun"
73 # A more modern dmenu replacement is rofi:
74 # bindcode $mod+40 exec rofi -modi drun,run -show drun
75 # There also is i3-dmenu-desktop which only displays applications shipping a
76 # .desktop file. It is a wrapper around dmenu, so you need that installed.
77
78 # change focus
79 bindsym $mod+n focus left
80 bindsym $mod+e focus down
81 bindsym $mod+i focus up
82 bindsym $mod+o focus right
83
84 # alternatively, you can use the cursor keys:
85 bindsym $mod+Left focus left
86 bindsym $mod+Down focus down
87 bindsym $mod+Up focus up
88 bindsym $mod+Right focus right
89
90 # move focused window
91 bindsym $mod+Shift+n move left
92 bindsym $mod+Shift+e move down
93 bindsym $mod+Shift+i move up
94 bindsym $mod+Shift+o move right
95
96 # alternatively, you can use the cursor keys:
97 bindsym $mod+Shift+Left move left
98 bindsym $mod+Shift+Down move down
99 bindsym $mod+Shift+Up move up
100 bindsym $mod+Shift+Right move right
101
102 # split in horizontal orientation
103 bindsym $mod+h split h
104
105 # split in vertical orientation
106 bindsym $mod+v split v
107
108 # enter fullscreen mode for the focused container
109 bindsym $mod+t fullscreen toggle
110
111 # change container layout (stacked, tabbed, toggle split)
112 bindsym $mod+r layout stacking
113 bindsym $mod+w layout tabbed
114 bindsym $mod+f layout toggle split
115
116 # toggle tiling / floating
117 bindsym $mod+Shift+space floating toggle
118
119 # change focus between tiling / floating windows
120 bindsym $mod+space focus mode_toggle
121
122 # focus the parent container
123 bindsym $mod+a focus parent
124
125 # focus the child container
126 #bindsym $mod+d focus child
127
128 # Define names for default workspaces for which we configure key bindings later on.
129 # We use variables to avoid repeating the names in multiple places.
130 set $ws1 "1"
131 set $ws2 "2"
132 set $ws3 "3"
133 set $ws4 "4"
134 set $ws5 "5"
135 set $ws6 "6"
136 set $ws7 "7"
137 set $ws8 "8"
138 set $ws9 "9"
139 set $ws10 "10"
140
141 set $chat "Chat"
142
143 # switch to workspace
144 bindsym $mod+1 workspace number $ws1
145 bindsym $mod+2 workspace number $ws2
146 bindsym $mod+3 workspace number $ws3
147 bindsym $mod+4 workspace number $ws4
148 bindsym $mod+5 workspace number $ws5
149 bindsym $mod+6 workspace number $ws6
150 bindsym $mod+7 workspace number $ws7
151 bindsym $mod+8 workspace number $ws8
152 bindsym $mod+9 workspace number $ws9
153 bindsym $mod+0 workspace number $ws10
154 bindsym $mod+z workspace $chat
155
156 # move focused container to workspace
157 bindsym $mod+Shift+1 move container to workspace number $ws1
158 bindsym $mod+Shift+2 move container to workspace number $ws2
159 bindsym $mod+Shift+3 move container to workspace number $ws3
160 bindsym $mod+Shift+4 move container to workspace number $ws4
161 bindsym $mod+Shift+5 move container to workspace number $ws5
162 bindsym $mod+Shift+6 move container to workspace number $ws6
163 bindsym $mod+Shift+7 move container to workspace number $ws7
164 bindsym $mod+Shift+8 move container to workspace number $ws8
165 bindsym $mod+Shift+9 move container to workspace number $ws9
166 bindsym $mod+Shift+0 move container to workspace number $ws10
167 bindsym $mod+Shift+z move container to workspace $chat
168
169 # reload the configuration file
170 bindsym $mod+Shift+c reload
171 # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
172 bindsym $mod+Shift+p restart
173 # exit i3 (logs you out of your X session)
174 bindsym $mod+Shift+f exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
175
176 # resize window (you can also use the mouse for that)
177 mode "resize" {
178         # These bindings trigger as soon as you enter the resize mode
179
180         # Pressing left will shrink the window’s width.
181         # Pressing right will grow the window’s width.
182         # Pressing up will shrink the window’s height.
183         # Pressing down will grow the window’s height.
184         bindsym n resize shrink width 10 px or 10 ppt
185         bindsym e resize grow height 10 px or 10 ppt
186         bindsym i resize shrink height 10 px or 10 ppt
187         bindsym o resize grow width 10 px or 10 ppt
188
189         # same bindings, but for the arrow keys
190         bindsym Left resize shrink width 10 px or 10 ppt
191         bindsym Down resize grow height 10 px or 10 ppt
192         bindsym Up resize shrink height 10 px or 10 ppt
193         bindsym Right resize grow width 10 px or 10 ppt
194
195         # back to normal: Enter or Escape or $mod+r
196         bindsym Return mode "default"
197         bindsym Escape mode "default"
198         bindsym $mod+p mode "default"
199 }
200
201 bindsym $mod+p mode "resize"
202
203 {% if host != 'baryte' %}
204 # Slight gaps around windows
205 gaps inner 6
206 {% endif %}
207
208 {% if host == 'barium' %}
209 bar {
210   id bar_left
211   status_command ~/.local/bin/conky-i3bar
212   position top
213   output "DP-1"
214   font pango:Liberation Mono 11
215   colors {
216     background $black_super
217     focused_background $black
218     focused_workspace $black_super $yellow_super $black
219     active_workspace $black_super $blue_super $black
220     inactive_workspace $black_super $black_super $white_super
221     urgent_workspace $black $red_super $white
222     separator $white
223   }
224 }
225
226 bar {
227   id bar_internal
228   status_command ~/.local/bin/conky-i3bar
229   position top
230   output "eDP-1"
231   font pango:Liberation Mono 12
232   colors {
233     background $black_super
234     focused_background $black
235     focused_workspace $black_super $yellow_super $black
236     active_workspace $black_super $blue_super $black
237     inactive_workspace $black_super $black_super $white_super
238     urgent_workspace $black $red_super $white
239     separator $white
240   }
241 }
242
243 bar {
244   id bar_right
245   status_command ~/.local/bin/conky-i3bar
246   position top
247   output "DP-2"
248   font pango:Liberation Mono 13
249   colors {
250     background $black_super
251     focused_background $black
252     focused_workspace $black_super $yellow_super $black
253     active_workspace $black_super $blue_super $black
254     inactive_workspace $black_super $black_super $white_super
255     urgent_workspace $black $red_super $white
256     separator $white
257   }
258 }
259
260 focus_on_window_activation urgent
261 no_focus [class="(!?.*pinentry.*)"]
262
263 workspace 2 output HDMI-A-1
264 workspace 4 output HDMI-A-1
265 workspace 1 output DP-1
266 workspace 3 output DP-1
267
268 workspace $chat output DP-1
269
270 assign [class="qutebrowser"] workspace number $ws1
271 for_window [class="qutebrowser"] move workspace number $ws1
272 assign [class="zoom"] workspace $chat
273 for_window [class="zoom"] move workspace $chat
274
275 exec "zoom"
276
277 {% elif host == 'baryte' %}
278 bar {
279   id bar_left
280   status_command ~/.local/bin/conky-i3bar
281   position top
282   output "DP-3"
283   font pango:Liberation Mono 11
284   colors {
285     background $black_super
286     focused_background $black
287     focused_workspace $black_super $yellow_super $black
288     active_workspace $black_super $blue_super $black
289     inactive_workspace $black_super $black_super $white_super
290     urgent_workspace $black $red_super $white
291     separator $white
292   }
293 }
294
295 bar {
296   id bar_internal
297   status_command ~/.local/bin/conky-i3bar
298   position top
299   output "eDP-1"
300   font pango:Liberation Mono 12
301   colors {
302     background $black_super
303     focused_background $black
304     focused_workspace $black_super $yellow_super $black
305     active_workspace $black_super $blue_super $black
306     inactive_workspace $black_super $black_super $white_super
307     urgent_workspace $black $red_super $white
308     separator $white
309   }
310 }
311
312 bar {
313   id bar_right
314   status_command ~/.local/bin/conky-i3bar
315   position top
316   output "HDMI-1"
317   font pango:Liberation Mono 13
318   colors {
319     background $black_super
320     focused_background $black
321     focused_workspace $black_super $yellow_super $black
322     active_workspace $black_super $blue_super $black
323     inactive_workspace $black_super $black_super $white_super
324     urgent_workspace $black $red_super $white
325     separator $white
326   }
327 }
328
329 focus_on_window_activation urgent
330 no_focus [class="(!?.*pinentry.*)"]
331
332 workspace 2 output HDMI-1
333 workspace 4 output HDMI-1
334 workspace 1 output DP-3
335 workspace 3 output DP-3
336
337 workspace $chat output DP-3
338
339 assign [class="qutebrowser"] workspace number $ws1
340 for_window [class="qutebrowser"] move workspace number $ws1
341 assign [class="zoom"] workspace $chat
342 for_window [class="zoom"] move workspace $chat
343
344 exec "zoom"
345
346
347 {% elif host == 'dubnium' %}
348 bar {
349   id bar_left
350   position top
351   output "DP-0"
352   font pango:Liberation Mono 12
353   colors {
354     background $black_super
355     focused_background $black
356     focused_workspace $black_super $yellow_super $black
357     active_workspace $black_super $blue_super $black
358     inactive_workspace $black_super $black_super $white_super
359     urgent_workspace $black $red_super $white
360     separator $white
361   }
362 }
363
364 bar {
365   id bar_right
366   status_command ~/.local/bin/conky-i3bar
367   position top
368   output "DP-2"
369   font pango:Liberation Mono 12
370   colors {
371     background $black_super
372     focused_background $black
373     focused_workspace $black_super $yellow_super $black
374     active_workspace $black_super $blue_super $black
375     inactive_workspace $black_super $black_super $white_super
376     urgent_workspace $black $red_super $white
377     separator $white
378   }
379 }
380
381 workspace 1 output DP-0
382 workspace 2 output DP-2
383
384 {% elif host == 'rhenium' %}
385 bar {
386   id bar_right
387   status_command ~/.local/bin/conky-i3bar
388   position top
389   output "eDP-1"
390   font pango:Liberation Mono 12
391   colors {
392     background $black_super
393     focused_background $black
394     focused_workspace $black_super $yellow_super $black
395     active_workspace $black_super $blue_super $black
396     inactive_workspace $black_super $black_super $white_super
397     urgent_workspace $black $red_super $white
398     separator $white
399   }
400 }
401 {% endif %}
402
403 exec dunst
404 exec picom -i 0.95 -D 4