i3 improvements wip
[distro-setup] / i3-sway / common.conf
1 ####### DO NOT EDIT LIVE CONFIG. generated from /a/bin/distro-setup/i3-sway/gen #######
2
3 # random thoughts: what to do with a window I don't have room for?
4 # * I could tabify it
5 # * I could split an existing window with it
6 # * I could send it away to another workspace,
7 # * I could resize it to be very small.
8
9
10 # todo: think whether this is useful: https://github.com/tmfink/i3-wk-switch
11 # todo: see comment by Jakstern551 here for tip about jumping to windows
12
13 # https://i3wm.org/docs/userguide.html#keybindings
14 #To get the current mapping of your keys, use xmodmap -pke. To
15 #interactively enter a key and see what keysym it is configured to, use
16 #xev.
17 set $mod Mod4
18
19 # for non-gui apps, use this.
20 set $ex exec --no-startup-id
21
22 bindsym $mod+2 $ex "i3-split-maybe"; exec "pavucontrol"
23 # calling without -no-remote makes this to be the instance that links
24 # will open in from other applications.
25 bindsym $mod+3 $ex "i3-split-maybe"; exec "abrowser"
26 # calling just abrowser mysteriously stopped working,
27 # so I figured out this is how to get output, but then
28 # it suddenly started working again.
29 #bindsym $mod+3 exec "abrowser 2>&1 >/tmp/l"
30 #bindsym $mod+3 exec "abrowser -no-remote -P sfw"
31 bindsym $mod+4 $ex "i3-split-maybe"; exec "abrowser -no-remote -P firefox-main-profile"
32 # todo: figure out a stream delay & way to cut the stream.
33 # settings, advanced, stream delay
34 bindsym $mod+5 $ex "/a/bin/ds/stream-interlude"
35 bindsym $mod+6 $ex "i3-split-maybe"; exec "/usr/local/bin/start-tor-browser"
36 bindsym $mod+7 $ex "/a/bin/ds/laptop-xrandr"
37 #bindsym $mod+6 $ex "/a/bin/redshift.sh"
38 # bindsym $mod+equal $ex "t s w; t in"
39 # bindsym $mod+Home $ex "t out"
40 # #bindsym $mod+End $ex "t s x; t in"
41 # bindsym $mod+grave $ex "t s lunch; t in; t out -a '45 minutes from now'"
42
43
44 bindsym $mod+1 focus parent
45 bindsym $mod+shift+1 focus child
46 # undo split: https://github.com/i3/i3/issues/3808
47 bindsym $mod+grave floating toggle; floating toggle
48 bindsym $mod+equal $ex "i3-set-layout splith"
49 # move firefox to current workspace.
50 # https://i3wm.org/docs/userguide.html#keybindings
51 # get class with xprop, example output
52 # WM_CLASS(STRING) = "irssi", "URxvt"
53 # xprop |& grep WM_CLASS
54 bindsym $mod+w $ex i3-pull abrowser
55 bindsym $mod+shift+w fullscreen toggle
56
57 bindsym $mod+e $ex i3-pull emacs
58 bindsym $mod+shift+e unmark emacs; mark emacs
59 bindsym $mod+r $ex "/a/bin/ds/xl"
60
61 bindsym $mod+t $ex "i3-set-layout splitv"
62 #bindsym $mod+Shift+t move workspace to output up
63 bindsym $mod+Shift+t move workspace to output right
64
65 # todo: consider a command that moves a window, and erases any single
66 # container window left behind.
67
68 # todo: consider a command which alters things as if the current window
69 # had been created into a single window split. For horizontal split,
70 # this would be like: focus left, split vertical, focus right, move
71 # left. With that, we could totally eliminate single window containers.
72
73 bindsym $mod+g $ex "i3-set-layout tabbed"
74
75
76 # Use Mouse+$mod to drag floating windows to their wanted position
77 floating_modifier $mod
78
79 bindsym $mod+u focus left; $ex "i3-mouse-warp"
80 # i dont expect to use this much
81 bindsym $mod+shift+u $ex "i3-auto-layout-toggle"
82 bindsym $mod+i focus right; $ex "i3-mouse-warp"
83 bindsym $mod+o focus up; $ex "i3-mouse-warp"
84 bindsym $mod+p focus down; $ex "i3-mouse-warp"
85
86 bindsym $mod+Left $ex "i3-split-push left"
87 bindsym $mod+Right $ex "i3-split-push right"
88 bindsym $mod+Up $ex "i3-split-push up"
89 bindsym $mod+Down $ex "i3-split-push down"
90
91 # for testing in case there is a problem with above.
92 # these could be rebound to other things.
93 bindsym $mod+shift+Left move left
94 bindsym $mod+shift+Right move right
95 bindsym $mod+shift+Up move up
96 bindsym $mod+shift+Down move down
97
98 bindsym $mod+Shift+a move container to workspace 4
99 bindsym $mod+a workspace 4
100
101 bindsym $mod+Shift+s move container to workspace 3
102 bindsym $mod+s workspace 3
103
104 bindsym $mod+Shift+d move container to workspace 2
105 bindsym $mod+d workspace 2
106
107 bindsym $mod+Shift+f move container to workspace 1
108 bindsym $mod+f workspace 1
109
110 bindsym $mod+Shift+z move container to workspace 5
111 bindsym $mod+z workspace 5
112
113 bindsym $mod+Shift+x move container to workspace 6
114 bindsym $mod+x workspace 6
115
116
117 # todo, in newer i3, make this split toggle
118 bindsym $mod+v split vertical
119 bindsym $mod+Shift+v split horizontal
120 #
121 ## temp for testing, add antying here
122 #bindsym $mod+shift+5
123
124
125
126
127 bindsym $mod+b $ex i3-pull term
128 bindsym $mod+shift+b unmark term; mark term
129 # for use to cleanup extra emacs windows
130 # https://faq.i3wm.org/question/7662/reverse-perl-matches-in-criteria-in-i3-config.1.html
131 # I found their regex slightly wrong. This is a hacky way to
132 # ignore my irc emacs instances, their window titles
133 # are irc room names. Another way would be to hack on the
134 # window title, or xprop stuff, but I figure I'm switching
135 # to wayland soon, lets wait and see how things work there.
136 bindsym $mod+shift+6 [class="Emacs" title="^(?!#[a-zA-Z][a-zA-Z-]*$)"] move workspace current
137
138 bindsym $mod+c kill
139
140
141 bindsym $mod+Shift+Home move container to workspace 7
142 bindsym $mod+Home workspace 7
143 bindsym $mod+Shift+q move container to workspace 8
144 bindsym $mod+q workspace 8
145
146 bindsym $mod+Shift+8 move container to workspace 9
147 bindsym $mod+8 workspace 9
148 bindsym $mod+Shift+9 move container to workspace 10
149 bindsym $mod+9 workspace 10
150
151 bindsym $mod+m $ex "dunstctl close-all"
152 bindsym $mod+Shift+m border toggle
153
154 # 65 = space.
155 # toggle tiling / floating.
156 #
157 # The idea here is: when floating a window, make it sticky and 1080p,
158 # because the only reason we want to do this is to keep it on screen
159 # when doing an obs broacast. When unfloating a window, just act as a
160 # normal unfloat. There is a quirk with this: in a layout with 3 windows,
161 # 2 stacked, 1 tall, floating and ufloating the tall one will make it
162 # another stacked one, but still 1920x1080, you need to move it to the
163 # right to get it back into its tall spot. I could automate this,
164 # but I'm not bothering right now
165 bindcode $mod+65 $ex obs-auto-scene-switch-toggle; floating toggle; sticky enable; resize set 1920 1080; move position 100 ppt 0 ppt
166
167 # change focus between tiling / floating windows
168 bindcode $mod+shift+65 focus mode_toggle
169 # Use Mouse+$mod to drag floating windows to their wanted position
170 floating_modifier $mod
171
172 bindsym $mod+shift+h $ex /b/ds/stream-clip hc
173 bindsym $mod+j $ex "i3-split-maybe"; exec emacsclient -c
174 bindsym $mod+shift+j $ex /b/ds/stream-clip up
175 bindsym $mod+k $ex "i3-split-maybe"; exec konsole
176 bindsym $mod+shift+k $ex /b/ds/stream-clip intro
177 bindsym $mod+l $ex dmenu_run
178 bindsym $mod+shift+l $ex /b/ds/stream-clip steady
179 bindsym $mod+shift+semicolon $ex /b/ds/stream-clip sad
180 # note default is 27% on my system76. not sure if these
181 # keybinds will screw up other laptop brightness keys.
182 bindsym XF86MonBrightnessUp $ex brightnessctl s +5%
183 bindsym XF86MonBrightnessDown $ex brightnessctl s 5%-
184
185 # Font for window titles. Will also be used by the bar unless a different font
186 # is used in the bar {} block below.
187 font pango:monospace 7
188
189 hide_edge_borders vertical
190
191 #exec --no-startup-id /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd
192
193 # Start clipster daemon
194 #exec --no-startup-id /a/opt/clipster/clipster -d
195
196
197 # shortcut to selection widget (primary)
198 bindsym $mod+End $ex "/b/ds/toggle-mute"
199
200 # title bars but no borders. i tried this out a bit
201 #default_border normal 0
202 default_border pixel 4
203 # for debugging
204 default_border normal 10
205
206 # I dont see a way to make processing windows act like normal windows,
207 # this does it.
208 # https://unix.stackexchange.com/questions/450700/opening-a-programme-in-a-floating-window-in-i3
209 #
210 # This is the info for a processing window launched from the ide.
211 # I'm not sure I want it like this, so commenting it out for now.
212 #for_window [class="processing-core-PApplet" instance="processing-core-PApplet"] floating disable
213
214 # this is the processing window for my app named focus.
215 for_window [class="focus" instance="focus"] floating disable
216
217 # client.focused #4c7899 #285577 #ffffff #2e9ef4 #ff4400
218 # client.focused_inactive #333333 #5f676a #ffffff #484e50 #DBEEF4
219 # client.unfocused #333333 #222222 #888888 #292d2e #B8C8CD