]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/i3/files/config.jinja
Use dunst instead of mako on i3
[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 # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
45 # screen before suspend. Use loginctl lock-session to lock your screen.
46 exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock -i ~/Pictures/lockscreen_full_blurred_1.png --nofork
47
48 # NetworkManager is the most popular way to manage wireless networks on Linux,
49 # and nm-applet is a desktop environment-independent system tray GUI for it.
50 exec --no-startup-id nm-applet
51
52 bindsym $mod+Shift+l exec systemctl suspend
53
54 # Use pactl to adjust volume in PulseAudio.
55 set $refresh_i3status killall -SIGUSR1 i3status
56 bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
57 bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
58 bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
59 bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
60
61 # Use Mouse+$mod to drag floating windows to their wanted position
62 floating_modifier $mod
63
64 # start a terminal
65 bindsym $mod+Return exec termite
66
67 # kill focused window
68 bindsym $mod+Shift+q kill
69
70 # start dmenu (a program launcher)
71 bindsym $mod+s exec "rofi -modi drun,run -show drun"
72 # A more modern dmenu replacement is rofi:
73 # bindcode $mod+40 exec rofi -modi drun,run -show drun
74 # There also is i3-dmenu-desktop which only displays applications shipping a
75 # .desktop file. It is a wrapper around dmenu, so you need that installed.
76
77 # change focus
78 bindsym $mod+n focus left
79 bindsym $mod+e focus down
80 bindsym $mod+i focus up
81 bindsym $mod+o focus right
82
83 # alternatively, you can use the cursor keys:
84 bindsym $mod+Left focus left
85 bindsym $mod+Down focus down
86 bindsym $mod+Up focus up
87 bindsym $mod+Right focus right
88
89 # move focused window
90 bindsym $mod+Shift+n move left
91 bindsym $mod+Shift+e move down
92 bindsym $mod+Shift+i move up
93 bindsym $mod+Shift+o move right
94
95 # alternatively, you can use the cursor keys:
96 bindsym $mod+Shift+Left move left
97 bindsym $mod+Shift+Down move down
98 bindsym $mod+Shift+Up move up
99 bindsym $mod+Shift+Right move right
100
101 # split in horizontal orientation
102 bindsym $mod+h split h
103
104 # split in vertical orientation
105 bindsym $mod+v split v
106
107 # enter fullscreen mode for the focused container
108 bindsym $mod+t fullscreen toggle
109
110 # change container layout (stacked, tabbed, toggle split)
111 bindsym $mod+r layout stacking
112 bindsym $mod+w layout tabbed
113 bindsym $mod+f layout toggle split
114
115 # toggle tiling / floating
116 bindsym $mod+Shift+space floating toggle
117
118 # change focus between tiling / floating windows
119 bindsym $mod+space focus mode_toggle
120
121 # focus the parent container
122 bindsym $mod+a focus parent
123
124 # focus the child container
125 #bindsym $mod+d focus child
126
127 # Define names for default workspaces for which we configure key bindings later on.
128 # We use variables to avoid repeating the names in multiple places.
129 set $ws1 "1"
130 set $ws2 "2"
131 set $ws3 "3"
132 set $ws4 "4"
133 set $ws5 "5"
134 set $ws6 "6"
135 set $ws7 "7"
136 set $ws8 "8"
137 set $ws9 "9"
138 set $ws10 "10"
139
140 set $music "Music"
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+m workspace $music
155 bindsym $mod+z workspace $chat
156
157 # move focused container to workspace
158 bindsym $mod+Shift+1 move container to workspace number $ws1
159 bindsym $mod+Shift+2 move container to workspace number $ws2
160 bindsym $mod+Shift+3 move container to workspace number $ws3
161 bindsym $mod+Shift+4 move container to workspace number $ws4
162 bindsym $mod+Shift+5 move container to workspace number $ws5
163 bindsym $mod+Shift+6 move container to workspace number $ws6
164 bindsym $mod+Shift+7 move container to workspace number $ws7
165 bindsym $mod+Shift+8 move container to workspace number $ws8
166 bindsym $mod+Shift+9 move container to workspace number $ws9
167 bindsym $mod+Shift+0 move container to workspace number $ws10
168 bindsym $mod+Shift+m move container to workspace $music
169 bindsym $mod+Shift+z move container to workspace $chat
170
171 # reload the configuration file
172 bindsym $mod+Shift+c reload
173 # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
174 bindsym $mod+Shift+p restart
175 # exit i3 (logs you out of your X session)
176 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'"
177
178 # resize window (you can also use the mouse for that)
179 mode "resize" {
180         # These bindings trigger as soon as you enter the resize mode
181
182         # Pressing left will shrink the window’s width.
183         # Pressing right will grow the window’s width.
184         # Pressing up will shrink the window’s height.
185         # Pressing down will grow the window’s height.
186         bindsym n resize shrink width 10 px or 10 ppt
187         bindsym e resize grow height 10 px or 10 ppt
188         bindsym i resize shrink height 10 px or 10 ppt
189         bindsym o resize grow width 10 px or 10 ppt
190
191         # same bindings, but for the arrow keys
192         bindsym Left resize shrink width 10 px or 10 ppt
193         bindsym Down resize grow height 10 px or 10 ppt
194         bindsym Up resize shrink height 10 px or 10 ppt
195         bindsym Right resize grow width 10 px or 10 ppt
196
197         # back to normal: Enter or Escape or $mod+r
198         bindsym Return mode "default"
199         bindsym Escape mode "default"
200         bindsym $mod+p mode "default"
201 }
202
203 bindsym $mod+p mode "resize"
204
205 # Slight gaps around windows
206 gaps inner 6
207
208 {% if host == 'barium' %}
209 bar {
210   id bar_left
211   position top
212   output "HDMI-1"
213   font pango:Liberation Mono 12
214   colors {
215     background $black_super
216     focused_background $black
217     focused_workspace $black_super $yellow_super $black
218     active_workspace $black_super $blue_super $black
219     inactive_workspace $black_super $black_super $white_super
220     urgent_workspace $black $red_super $white
221     separator $white
222   }
223 }
224
225 bar {
226   id bar_internal
227   status_command ~/.local/bin/conky-i3bar
228   position top
229   output "eDP-1"
230   font pango:Liberation Mono 12
231   colors {
232     background $black_super
233     focused_background $black
234     focused_workspace $black_super $yellow_super $black
235     active_workspace $black_super $blue_super $black
236     inactive_workspace $black_super $black_super $white_super
237     urgent_workspace $black $red_super $white
238     separator $white
239   }
240 }
241
242 bar {
243   id bar_right
244   status_command ~/.local/bin/conky-i3bar
245   position top
246   output "DP-1"
247   font pango:Liberation Mono 12
248   colors {
249     background $black_super
250     focused_background $black
251     focused_workspace $black_super $yellow_super $black
252     active_workspace $black_super $blue_super $black
253     inactive_workspace $black_super $black_super $white_super
254     urgent_workspace $black $red_super $white
255     separator $white
256   }
257 }
258
259 workspace 2 output HDMI-A-1
260 workspace 4 output HDMI-A-1
261 workspace 1 output DP-1
262 workspace 3 output DP-1
263
264 workspace $music output DP-1
265 workspace $chat output DP-1 
266
267 assign [class="music"] workspace $music
268 for_window [class="music"] move workspace number $music
269 assign [class="qutebrowser"] workspace number $ws1
270 for_window [class="qutebrowser"] move workspace number $ws1
271 assign [class="zoom"] workspace $chat
272 for_window [class="zoom"] move workspace $chat
273
274 exec "termite --name 'music' -e 'tmux'"
275 exec "zoom"
276
277 {% elif host == 'dubnium' %}
278 bar {
279   id bar_left
280   position top
281   output "DVI-D-1"
282   font pango:Liberation Mono 12
283   colors {
284     background $black_super
285     focused_background $black
286     focused_workspace $black_super $yellow_super $black
287     active_workspace $black_super $blue_super $black
288     inactive_workspace $black_super $black_super $white_super
289     urgent_workspace $black $red_super $white
290     separator $white
291   }
292 }
293
294 bar {
295   id bar_right
296   status_command ~/.local/bin/conky-i3bar
297   position top
298   output "DP-1"
299   font pango:Liberation Mono 12
300   colors {
301     background $black_super
302     focused_background $black
303     focused_workspace $black_super $yellow_super $black
304     active_workspace $black_super $blue_super $black
305     inactive_workspace $black_super $black_super $white_super
306     urgent_workspace $black $red_super $white
307     separator $white
308   }
309 }
310
311 workspace 1 output DVI-D-1
312 workspace 2 output DP-1
313
314 {% elif host == 'rhenium' %}
315 bar {
316   id bar_right
317   status_command ~/.local/bin/conky-i3bar
318   position top
319   output "eDP-1"
320   font pango:Liberation Mono 12
321   colors {
322     background $black_super
323     focused_background $black
324     focused_workspace $black_super $yellow_super $black
325     active_workspace $black_super $blue_super $black
326     inactive_workspace $black_super $black_super $white_super
327     urgent_workspace $black $red_super $white
328     separator $white
329   }
330 }
331 {% endif %}
332
333 exec dunst
334 exec picom -i 0.95 -D 4