]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/sway/files/config.jinja
Sway configuration for magnesium
[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
31 set $mod Mod4
32
33 # Slight gaps between windows
34 gaps inner 5
35 gaps outer 5
36
37 # Use Mouse+$mod to drag floating windows to their wanted position
38 floating_modifier $mod
39
40 bindsym Control+t mode "$ratpoison"
41
42 set $ws1 "1"
43 set $ws2 "2"
44 set $ws3 "3"
45 set $ws4 "4"
46 set $ws5 "5"
47 set $ws6 "6"
48 set $ws7 "7"
49 set $ws8 "8"
50 set $ws9 "9"
51 set $ws10 "10"
52
53 mode "$ratpoison" {
54 # All/most commands in this mode should revert to the default mode on comleption.
55 # We are emulating ratpoison (kinda) here
56
57 # Moving to workspaces
58 #  bindsym n workspace next mode "default"
59 #    bindsym Shift+n workspace prev mode "default"
60
61     bindsym 1 exec 'swaymsg mode "default"; swaymsg workspace $ws1'
62     bindsym 2 exec 'swaymsg mode "default"; swaymsg workspace $ws2'
63     bindsym 3 exec 'swaymsg mode "default"; swaymsg workspace $ws3'
64     bindsym 4 exec 'swaymsg mode "default"; swaymsg workspace $ws4'
65     bindsym 5 exec 'swaymsg mode "default"; swaymsg workspace $ws5'
66     bindsym 6 exec 'swaymsg mode "default"; swaymsg workspace $ws6'
67     bindsym 7 exec 'swaymsg mode "default"; swaymsg workspace $ws7'
68     bindsym 8 exec 'swaymsg mode "default"; swaymsg workspace $ws8'
69     bindsym 9 exec 'swaymsg mode "default"; swaymsg workspace $ws9'
70     bindsym 0 exec 'swaymsg mode "default"; swaymsg workspace $ws10'
71
72     bindsym Shift+1 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws1'
73     bindsym Shift+2 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws2'
74     bindsym Shift+3 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws3'
75     bindsym Shift+4 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws4'
76     bindsym Shift+5 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws5'
77     bindsym Shift+6 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws6'
78     bindsym Shift+7 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws7'
79     bindsym Shift+8 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws8'
80     bindsym Shift+9 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws9'
81     bindsym Shift+0 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws10'
82
83 # Moving focus
84 #    bindsym Tab focus right mode "default"
85 #    bindsym Shift+Tab focus left mode "default"
86
87     bindsym h exec 'swaymsg mode "default"; swaymsg focus left'
88     bindsym j exec 'swaymsg mode "default"; swaymsg focus down' 
89     bindsym k exec 'swaymsg mode "default"; swaymsg focus up' 
90     bindsym l exec 'swaymsg mode "default"; swaymsg focus right' 
91
92
93 # Moving windows
94     bindsym Shift+h exec 'swaymsg mode "default"; swaymsg move left'
95     bindsym Shift+j exec 'swaymsg mode "default"; swaymsg move down'
96     bindsym Shift+k exec 'swaymsg mode "default"; swaymsg move up'
97     bindsym Shift+l exec 'swaymsg mode "default"; swaymsg move right'
98
99 # Changing split modes
100     bindsym v exec 'swaymsg mode "default"; swaymsg split v'
101     bindsym o exec 'swaymsg mode "default"; swaymsg split h'
102
103
104     bindsym c exec 'swaymsg mode "default"; swaymsg exec termite'
105     bindsym q exec 'swaymsg mode "default"; swaymsg kill'
106
107     bindsym Shift+e exec 'swaymsg mode "default"; swaymsg exec dmenu_run'
108
109     bindsym $mod+l exec 'swaymsg mode "default"; "lock.{{ host }}"' 
110     bindsym Escape mode "default"
111 }
112
113
114
115 # There also is the (new) i3-dmenu-desktop which only displays applications
116 # shipping a .desktop file. It is a wrapper around dmenu, so you need that
117 # installed.
118 # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
119
120 # enter fullscreen mode for the focused container
121 bindsym $mod+t fullscreen toggle
122
123 # change container layout (stacked, tabbed, toggle split)
124 bindsym $mod+r layout stacking
125 bindsym $mod+w layout tabbed
126 bindsym $mod+f layout toggle split
127
128 # toggle tiling / floating
129 bindsym $mod+Shift+space floating toggle
130
131 # change focus between tiling / floating windows
132 bindsym $mod+space focus mode_toggle
133
134 # focus the parent container
135 bindsym $mod+a focus parent
136
137 # focus the child container
138 #bindsym $mod+d focus child
139
140 #reload the configuration file
141 bindsym $mod+Shift+c reload
142 # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
143 bindsym $mod+Shift+r restart
144 # exit i3 (logs you out of your X session)
145 bindsym $mod+Shift+e 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'"
146
147 # resize window (you can also use the mouse for that)
148 mode "resize" {
149 # These bindings trigger as soon as you enter the resize mode
150
151 # Pressing left will shrink the window’s width.
152 # Pressing right will grow the window’s width.
153 # Pressing up will shrink the window’s height.
154 # Pressing down will grow the window’s height.
155   bindsym h resize shrink width 10 px or 10 ppt
156     bindsym j resize grow height 10 px or 10 ppt
157     bindsym k resize shrink height 10 px or 10 ppt
158     bindsym l resize grow width 10 px or 10 ppt
159
160 # same bindings, but for the arrow keys
161     bindsym Left resize shrink width 10 px or 10 ppt
162     bindsym Down resize grow height 10 px or 10 ppt
163     bindsym Up resize shrink height 10 px or 10 ppt
164     bindsym Right resize grow width 10 px or 10 ppt
165
166 # back to normal: Enter or Escape or $mod+r
167     bindsym Return mode "default"
168     bindsym Escape mode "default"
169     bindsym $mod+p mode "default"
170 }
171
172 bindsym $mod+p mode "resize"
173
174
175
176 hide_edge_borders both 
177
178 focus_follows_mouse no
179
180 focus_on_window_activation urgent
181
182 for_window [class="^rdesktop"] move workspace number 9; floating disable
183 for_window [class="Pinentry"] floating enable
184
185 exec swayidle \
186   timeout 300 "lock.{{ host }}" \
187   timeout 600 'swaymsg "output * dpms off"' \
188     resume 'swaymsg "output * dpms on" \
189   before-sleep "lock.{{ host }}"
190
191 # Magnesium specific section
192 {% if host == 'magnesium' %}
193 bar {
194   id bar_left
195   status_command conky-i3bar
196   position top
197   output "HDMI-A-3"
198   font pango:Liberation Mono 10
199   colors {
200     background $black_super
201     focused_background $black
202     focused_workspace $black_super $yellow_super $black
203     active_workspace $black_super $blue_super $black
204     inactive_workspace $black_super $black_super $white_super
205     urgent_workspace $black $red_super $white
206   }
207 }
208
209 bar {
210   id bar_right
211   position top
212   output "HDMI-A-2"
213   font pango:Liberation Mono 10
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   }
222 }
223
224
225 workspace 1 output HDMI-A-3
226 workspace 2 output HDMI-A-2
227
228 output HDMI-A-2 {
229   position 0 1080
230   background ~/Pictures/background_1080_1.png fit
231 }
232
233 output HDMI-A-3 {
234   position 0 0
235   background ~/Pictures/background_1080_2.png fit
236 }
237
238
239
240 font pango:Liberation Mono 8
241
242 input 1241:36:HOLDCHIP_USB_Keyboard {
243   xkb_layout us
244   xkb_variant colemak
245   xkb_options ctrl:nocaps
246 }
247 {% endif %}