]> git.friedersdorff.com Git - max/dotfiles.git/blob - sway/.config/sway/config.base
Move keyboard layout logic into sway config
[max/dotfiles.git] / sway / .config / sway / config.base
1 # Colors
2 set $black #000000
3 set $black_super #555555
4
5 set $red #f92672
6 set $red_super #dd4278
7
8 set $green #74e22e
9 set $green_super #9dc54b
10
11 set $yellow #e6db74
12 set $yellow_super #d1ca89
13
14 set $blue #66d9ef
15 set $blue_super #7accda
16
17 set $magenta #ae81ff
18 set $magenta_super #b392ef
19
20 set $cyan #00d9d9
21 set $cyan_super #c8f0f0
22
23 set $white #f5deb3
24 set $white_super #ffffff
25
26 client.focused $black $yellow_super $black $black $black
27 client.focused_inactive $black $black_super $white $black $black 
28
29
30 set $mod Mod4
31
32 # Slight gaps between windows
33 gaps inner 5
34 gaps outer 5
35
36 # Use Mouse+$mod to drag floating windows to their wanted position
37 floating_modifier $mod
38
39 bindsym Control+t mode "$ratpoison"
40
41 set $ws1 "1"
42 set $ws2 "2"
43 set $ws3 "3"
44 set $ws4 "4"
45 set $ws5 "5"
46 set $ws6 "6"
47 set $ws7 "7"
48 set $ws8 "8"
49 set $ws9 "9"
50 set $ws10 "10"
51
52 mode "$ratpoison" {
53 # All/most commands in this mode should revert to the default mode on comleption.
54 # We are emulating ratpoison (kinda) here
55
56 # Moving to workspaces
57 #  bindsym n workspace next mode "default"
58 #    bindsym Shift+n workspace prev mode "default"
59
60     bindsym 1 exec 'swaymsg mode "default"; swaymsg workspace $ws1'
61     bindsym 2 exec 'swaymsg mode "default"; swaymsg workspace $ws2'
62     bindsym 3 exec 'swaymsg mode "default"; swaymsg workspace $ws3'
63     bindsym 4 exec 'swaymsg mode "default"; swaymsg workspace $ws4'
64     bindsym 5 exec 'swaymsg mode "default"; swaymsg workspace $ws5'
65     bindsym 6 exec 'swaymsg mode "default"; swaymsg workspace $ws6'
66     bindsym 7 exec 'swaymsg mode "default"; swaymsg workspace $ws7'
67     bindsym 8 exec 'swaymsg mode "default"; swaymsg workspace $ws8'
68     bindsym 9 exec 'swaymsg mode "default"; swaymsg workspace $ws9'
69     bindsym 0 exec 'swaymsg mode "default"; swaymsg workspace $ws10'
70
71     bindsym Shift+1 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws1'
72     bindsym Shift+2 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws2'
73     bindsym Shift+3 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws3'
74     bindsym Shift+4 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws4'
75     bindsym Shift+5 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws5'
76     bindsym Shift+6 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws6'
77     bindsym Shift+7 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws7'
78     bindsym Shift+8 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws8'
79     bindsym Shift+9 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws9'
80     bindsym Shift+0 exec 'swaymsg mode "default"; swaymsg move container to workspace $ws10'
81
82 # Moving focus
83 #    bindsym Tab focus right mode "default"
84 #    bindsym Shift+Tab focus left mode "default"
85
86     bindsym h exec 'swaymsg mode "default"; swaymsg focus left'
87     bindsym j exec 'swaymsg mode "default"; swaymsg focus down' 
88     bindsym k exec 'swaymsg mode "default"; swaymsg focus up' 
89     bindsym l exec 'swaymsg mode "default"; swaymsg focus right' 
90
91
92 # Moving windows
93     bindsym Shift+h exec 'swaymsg mode "default"; swaymsg move left'
94     bindsym Shift+j exec 'swaymsg mode "default"; swaymsg move down'
95     bindsym Shift+k exec 'swaymsg mode "default"; swaymsg move up'
96     bindsym Shift+l exec 'swaymsg mode "default"; swaymsg move right'
97
98 # Changing split modes
99     bindsym v exec 'swaymsg mode "default"; swaymsg split v'
100     bindsym o exec 'swaymsg mode "default"; swaymsg split h'
101
102
103     bindsym c exec 'swaymsg mode "default"; swaymsg exec termite'
104     bindsym q exec 'swaymsg mode "default"; swaymsg kill'
105
106     bindsym Shift+e exec 'swaymsg mode "default"; swaymsg exec dmenu_run'
107
108     bindsym $mod+l exec 'swaymsg mode "default"; "lock.${HOSTNAME}"' 
109     bindsym Escape mode "default"
110 }
111
112
113
114 # There also is the (new) i3-dmenu-desktop which only displays applications
115 # shipping a .desktop file. It is a wrapper around dmenu, so you need that
116 # installed.
117 # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
118
119 # enter fullscreen mode for the focused container
120 bindsym $mod+t fullscreen toggle
121
122 # change container layout (stacked, tabbed, toggle split)
123 bindsym $mod+r layout stacking
124 bindsym $mod+w layout tabbed
125 bindsym $mod+f layout toggle split
126
127 # toggle tiling / floating
128 bindsym $mod+Shift+space floating toggle
129
130 # change focus between tiling / floating windows
131 bindsym $mod+space focus mode_toggle
132
133 # focus the parent container
134 bindsym $mod+a focus parent
135
136 # focus the child container
137 #bindsym $mod+d focus child
138
139 #reload the configuration file
140 bindsym $mod+Shift+c reload
141 # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
142 bindsym $mod+Shift+r restart
143 # exit i3 (logs you out of your X session)
144 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'"
145
146 # resize window (you can also use the mouse for that)
147 mode "resize" {
148 # These bindings trigger as soon as you enter the resize mode
149
150 # Pressing left will shrink the window’s width.
151 # Pressing right will grow the window’s width.
152 # Pressing up will shrink the window’s height.
153 # Pressing down will grow the window’s height.
154   bindsym h resize shrink width 10 px or 10 ppt
155     bindsym j resize grow height 10 px or 10 ppt
156     bindsym k resize shrink height 10 px or 10 ppt
157     bindsym l resize grow width 10 px or 10 ppt
158
159 # same bindings, but for the arrow keys
160     bindsym Left resize shrink width 10 px or 10 ppt
161     bindsym Down resize grow height 10 px or 10 ppt
162     bindsym Up resize shrink height 10 px or 10 ppt
163     bindsym Right resize grow width 10 px or 10 ppt
164
165 # back to normal: Enter or Escape or $mod+r
166     bindsym Return mode "default"
167     bindsym Escape mode "default"
168     bindsym $mod+p mode "default"
169 }
170
171 bindsym $mod+p mode "resize"
172
173
174
175 hide_edge_borders both 
176
177 focus_follows_mouse no
178
179 focus_on_window_activation urgent
180
181 for_window [class="^rdesktop"] move workspace number 9; floating disable
182 for_window [class="Pinentry"] floating enable
183
184 exec swayidle \
185   timeout 300 "lock.${HOSTNAME}" \
186   timeout 600 'swaymsg "output * dpms off"' \
187     resume 'swaymsg "output * dpms on" \
188   before-sleep "lock.${HOSTNAME}"