]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/i3/files/config.jinja
Add i3 configuration
[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 --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 # Use pactl to adjust volume in PulseAudio.
53 set $refresh_i3status killall -SIGUSR1 i3status
54 bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
55 bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
56 bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
57 bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
58
59 # Use Mouse+$mod to drag floating windows to their wanted position
60 floating_modifier $mod
61
62 # start a terminal
63 bindsym $mod+Return exec termite
64
65 # kill focused window
66 bindsym $mod+Shift+q kill
67
68 # start dmenu (a program launcher)
69 bindsym $mod+s exec "rofi -modi drun,run -show drun"
70 # A more modern dmenu replacement is rofi:
71 # bindcode $mod+40 exec rofi -modi drun,run -show drun
72 # There also is i3-dmenu-desktop which only displays applications shipping a
73 # .desktop file. It is a wrapper around dmenu, so you need that installed.
74
75 # change focus
76 bindsym $mod+n focus left
77 bindsym $mod+e focus down
78 bindsym $mod+i focus up
79 bindsym $mod+o focus right
80
81 # alternatively, you can use the cursor keys:
82 bindsym $mod+Left focus left
83 bindsym $mod+Down focus down
84 bindsym $mod+Up focus up
85 bindsym $mod+Right focus right
86
87 # move focused window
88 bindsym $mod+Shift+n move left
89 bindsym $mod+Shift+e move down
90 bindsym $mod+Shift+i move up
91 bindsym $mod+Shift+o move right
92
93 # alternatively, you can use the cursor keys:
94 bindsym $mod+Shift+Left move left
95 bindsym $mod+Shift+Down move down
96 bindsym $mod+Shift+Up move up
97 bindsym $mod+Shift+Right move right
98
99 # split in horizontal orientation
100 bindsym $mod+h split h
101
102 # split in vertical orientation
103 bindsym $mod+v split v
104
105 # enter fullscreen mode for the focused container
106 bindsym $mod+t fullscreen toggle
107
108 # change container layout (stacked, tabbed, toggle split)
109 bindsym $mod+r layout stacking
110 bindsym $mod+w layout tabbed
111 bindsym $mod+f layout toggle split
112
113 # toggle tiling / floating
114 bindsym $mod+Shift+space floating toggle
115
116 # change focus between tiling / floating windows
117 bindsym $mod+space focus mode_toggle
118
119 # focus the parent container
120 bindsym $mod+a focus parent
121
122 # focus the child container
123 #bindsym $mod+d focus child
124
125 # Define names for default workspaces for which we configure key bindings later on.
126 # We use variables to avoid repeating the names in multiple places.
127 set $ws1 "1"
128 set $ws2 "2"
129 set $ws3 "3"
130 set $ws4 "4"
131 set $ws5 "5"
132 set $ws6 "6"
133 set $ws7 "7"
134 set $ws8 "8"
135 set $ws9 "9"
136 set $ws10 "10"
137
138 set $music "Music"
139 set $chat "Chat"
140
141 # switch to workspace
142 bindsym $mod+1 workspace number $ws1
143 bindsym $mod+2 workspace number $ws2
144 bindsym $mod+3 workspace number $ws3
145 bindsym $mod+4 workspace number $ws4
146 bindsym $mod+5 workspace number $ws5
147 bindsym $mod+6 workspace number $ws6
148 bindsym $mod+7 workspace number $ws7
149 bindsym $mod+8 workspace number $ws8
150 bindsym $mod+9 workspace number $ws9
151 bindsym $mod+0 workspace number $ws10
152 bindsym $mod+m workspace $music
153 bindsym $mod+z workspace $chat
154
155 # move focused container to workspace
156 bindsym $mod+Shift+1 move container to workspace number $ws1
157 bindsym $mod+Shift+2 move container to workspace number $ws2
158 bindsym $mod+Shift+3 move container to workspace number $ws3
159 bindsym $mod+Shift+4 move container to workspace number $ws4
160 bindsym $mod+Shift+5 move container to workspace number $ws5
161 bindsym $mod+Shift+6 move container to workspace number $ws6
162 bindsym $mod+Shift+7 move container to workspace number $ws7
163 bindsym $mod+Shift+8 move container to workspace number $ws8
164 bindsym $mod+Shift+9 move container to workspace number $ws9
165 bindsym $mod+Shift+0 move container to workspace number $ws10
166 bindsym $mod+Shift+m move container to workspace $music
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 bar {
204   id bar_left
205   position top
206   output "HDMI-1"
207   font pango:Liberation Mono 12
208   colors {
209     background $black_super
210     focused_background $black
211     focused_workspace $black_super $yellow_super $black
212     active_workspace $black_super $blue_super $black
213     inactive_workspace $black_super $black_super $white_super
214     urgent_workspace $black $red_super $white
215     separator $white
216   }
217 }
218
219 bar {
220   id bar_internal
221   status_command ~/.local/bin/conky-i3bar
222   position top
223   output "eDP-1"
224   font pango:Liberation Mono 12
225   colors {
226     background $black_super
227     focused_background $black
228     focused_workspace $black_super $yellow_super $black
229     active_workspace $black_super $blue_super $black
230     inactive_workspace $black_super $black_super $white_super
231     urgent_workspace $black $red_super $white
232     separator $white
233   }
234 }
235
236 bar {
237   id bar_right
238   status_command ~/.local/bin/conky-i3bar
239   position top
240   output "DP-1"
241   font pango:Liberation Mono 12
242   colors {
243     background $black_super
244     focused_background $black
245     focused_workspace $black_super $yellow_super $black
246     active_workspace $black_super $blue_super $black
247     inactive_workspace $black_super $black_super $white_super
248     urgent_workspace $black $red_super $white
249     separator $white
250   }
251 }
252
253 # Slight gaps around windows
254 gaps inner 6
255
256 workspace 2 output HDMI-A-1
257 workspace 4 output HDMI-A-1
258 workspace 1 output DP-1
259 workspace 3 output DP-1
260
261 workspace $music output DP-1
262 workspace $chat output DP-1 
263
264 assign [class="music"] workspace $music
265 for_window [class="music"] move workspace number $music
266 assign [class="qutebrowser"] workspace number $ws1
267 for_window [class="qutebrowser"] move workspace number $ws1
268 assign [class="zoom"] workspace $chat
269 for_window [class="zoom"] move workspace $chat
270
271 exec "termite --name 'music' -e 'tmux'"
272 exec "zoom"
273
274 exec mako
275 exec picom -i 0.95