]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/sway/files/config.jinja
Set keyboard layout for CM quickfire
[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 set $music "Music"
54 set $chat "Chat"
55
56 mode "$ratpoison" {
57 # All/most commands in this mode should revert to the default mode on comleption.
58 # We are emulating ratpoison (kinda) here
59
60 # Moving to workspaces
61 #  bindsym n workspace next mode "default"
62 #    bindsym Shift+n workspace prev mode "default"
63
64     bindsym 1 exec 'swaymsg mode "default"; swaymsg workspace $ws1'
65     bindsym 2 exec 'swaymsg mode "default"; swaymsg workspace $ws2'
66     bindsym 3 exec 'swaymsg mode "default"; swaymsg workspace $ws3'
67     bindsym 4 exec 'swaymsg mode "default"; swaymsg workspace $ws4'
68     bindsym 5 exec 'swaymsg mode "default"; swaymsg workspace $ws5'
69     bindsym 6 exec 'swaymsg mode "default"; swaymsg workspace $ws6'
70     bindsym 7 exec 'swaymsg mode "default"; swaymsg workspace $ws7'
71     bindsym 8 exec 'swaymsg mode "default"; swaymsg workspace $ws8'
72     bindsym 9 exec 'swaymsg mode "default"; swaymsg workspace $ws9'
73     bindsym 0 exec 'swaymsg mode "default"; swaymsg workspace $ws10'
74     bindsym m exec 'swaymsg mode "default"; swaymsg workspace $music'
75     bindsym a exec 'swaymsg mode "default"; swaymsg workspace $chat'
76
77
78     bindsym Shift+1 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws1'
79     bindsym Shift+2 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws2'
80     bindsym Shift+3 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws3'
81     bindsym Shift+4 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws4'
82     bindsym Shift+5 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws5'
83     bindsym Shift+6 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws6'
84     bindsym Shift+7 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws7'
85     bindsym Shift+8 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws8'
86     bindsym Shift+9 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws9'
87     bindsym Shift+0 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws10'
88     bindsym Shift+m exec 'swaymsg mode "default"; swaymsg move container to workspace $music'
89     bindsym Shift+a exec 'swaymsg mode "default"; swaymsg move container to workspace $chat'
90
91 # Moving focus
92 #    bindsym Tab focus right mode "default"
93 #    bindsym Shift+Tab focus left mode "default"
94
95     bindsym h exec 'swaymsg mode "default"; swaymsg focus left'
96     bindsym j exec 'swaymsg mode "default"; swaymsg focus down' 
97     bindsym k exec 'swaymsg mode "default"; swaymsg focus up' 
98     bindsym l exec 'swaymsg mode "default"; swaymsg focus right' 
99
100
101 # Moving windows
102     bindsym Shift+h exec 'swaymsg mode "default"; swaymsg move left'
103     bindsym Shift+j exec 'swaymsg mode "default"; swaymsg move down'
104     bindsym Shift+k exec 'swaymsg mode "default"; swaymsg move up'
105     bindsym Shift+l exec 'swaymsg mode "default"; swaymsg move right'
106
107 # Changing split modes
108     bindsym v exec 'swaymsg mode "default"; swaymsg split v'
109     bindsym o exec 'swaymsg mode "default"; swaymsg split h'
110
111
112     bindsym c exec 'swaymsg mode "default"; swaymsg exec termite'
113     bindsym q exec 'swaymsg mode "default"; swaymsg kill'
114
115     bindsym Shift+e exec 'swaymsg mode "default"; swaymsg exec dmenu_run'
116
117     bindsym $mod+l exec 'swaymsg mode "default"; "lock.nosmartcard"' 
118     bindsym Escape mode "default"
119 }
120
121
122
123 # There also is the (new) i3-dmenu-desktop which only displays applications
124 # shipping a .desktop file. It is a wrapper around dmenu, so you need that
125 # installed.
126 # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
127
128 # enter fullscreen mode for the focused container
129 bindsym $mod+t fullscreen toggle
130
131 # change container layout (stacked, tabbed, toggle split)
132 bindsym $mod+r layout stacking
133 bindsym $mod+w layout tabbed
134 bindsym $mod+f layout toggle split
135
136 # toggle tiling / floating
137 bindsym $mod+Shift+space floating toggle
138
139 # change focus between tiling / floating windows
140 bindsym $mod+space focus mode_toggle
141
142 # focus the parent container
143 bindsym $mod+a focus parent
144
145 # focus the child container
146 #bindsym $mod+d focus child
147
148 #reload the configuration file
149 bindsym $mod+Shift+c reload
150 # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
151 bindsym $mod+Shift+r restart
152 # exit i3 (logs you out of your X session)
153 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'"
154
155 # resize window (you can also use the mouse for that)
156 mode "resize" {
157 # These bindings trigger as soon as you enter the resize mode
158
159 # Pressing left will shrink the window’s width.
160 # Pressing right will grow the window’s width.
161 # Pressing up will shrink the window’s height.
162 # Pressing down will grow the window’s height.
163   bindsym h resize shrink width 10 px or 10 ppt
164     bindsym j resize grow height 10 px or 10 ppt
165     bindsym k resize shrink height 10 px or 10 ppt
166     bindsym l resize grow width 10 px or 10 ppt
167
168 # same bindings, but for the arrow keys
169     bindsym Left resize shrink width 10 px or 10 ppt
170     bindsym Down resize grow height 10 px or 10 ppt
171     bindsym Up resize shrink height 10 px or 10 ppt
172     bindsym Right resize grow width 10 px or 10 ppt
173
174 # back to normal: Enter or Escape or $mod+r
175     bindsym Return mode "default"
176     bindsym Escape mode "default"
177     bindsym $mod+p mode "default"
178 }
179
180 bindsym $mod+p mode "resize"
181
182 bindsym XF86MonBrightnessUp exec "brightnessctl set +100"
183 bindsym XF86MonBrightnessDown exec "brightnessctl set 100-"
184
185 bindsym XF86ScreenSaver exec "lock.nosmartcard"
186
187 hide_edge_borders both 
188
189 focus_follows_mouse no
190
191 focus_on_window_activation urgent
192
193 for_window [class="^rdesktop"] move workspace number 9; floating disable
194 for_window [class="Pinentry"] floating enable
195
196 {% set lockcmd = "swaylock -e -f -i ~/Pictures/lockscreen_1080_1.png" %}
197
198 exec swayidle -w \
199 timeout 300 "{{lockcmd}}" \
200   timeout 600 'systemctl suspend' \
201     before-sleep "{{lockcmd}}"
202
203 # This keyboard has this layout on all machines:
204 input 1241:36:HOLDCHIP_USB_Keyboard {
205   xkb_layout us
206   xkb_variant colemak
207   xkb_options ctrl:nocaps
208 }
209
210 input 16700:8455:DELL_Dell_USB_Entry_Keyboard {
211   xkb_layout gb
212   xkb_variant colemak
213   xkb_options ctrl:nocaps
214 }
215
216 input 7504:24616:unspecified_ErgoDox_ergonomic_keyboard {
217   xkb_layout gb
218 }
219
220 input 9494:21:CM_Storm_Quickfire_Pro_Ultimate_6_key {
221   xkb_layout gb
222   xkb_variant colemak
223   xkb_options ctrl:nocaps
224 }
225 # host specific section
226 {%- do salt.log.error('sway/files/' + host) -%}
227 {% include 'sway/files/' + host %}