uh-wm 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 304d345d72ebfed7045a3ac0cd0bdb58fe8fbd31
4
- data.tar.gz: cb5379acb77ac283dbb0f28b27e4e93fe9e13b5f
3
+ metadata.gz: 6e40ae2e6f815683ba49a0cf70e0a2832b15198a
4
+ data.tar.gz: 2f2c5eabef44d6acfa2dbb4901d81fea647b121f
5
5
  SHA512:
6
- metadata.gz: fdc8985073e35f6d54f1d627e0233ab0ebdad4cfe25ce0baf8d7b1847083f942fc91fbf9e36ee4bac812f489df4bc190660d947bcdcf8e6f5454380376363897
7
- data.tar.gz: a69f26be2e7bfd9781222840f0bec1508d962f7fc192e2b5908718dd496f7a996827cee6f6abc92b2639e173766b7a10164772cd8d6f221ba2966cc79a52bc09
6
+ metadata.gz: d423c12bb61f6fce43f7c2fb28b8d3a823197abb719dbe02380706dfcf4755b7e190b0fe8e8d72a683e8e883e9659272eae7d43244abe1ab3b0ef208af9ba19a
7
+ data.tar.gz: 0a21755650d31e190d9df030866a2822d9fe347dc4ed7f94b90834f5312331135fb26151ab3b4a5df9014fd1e8d7debee1cd6c468392734e174aa025c877350a
data/README.md CHANGED
@@ -22,11 +22,11 @@ specific messages, so it's easy to write your own layout.
22
22
  * configuration with a run control file;
23
23
  * key bindings with user defined code as callback;
24
24
  * configurable modifier key;
25
- * support user-defined layout strategies;
25
+ * user-defined layout strategies;
26
26
  * external program execution;
27
27
  * no re-parenting (therefore, no window decoration either);
28
28
  * no grabbing of the modifier key alone;
29
- * no mouse handling;
29
+ * no mouse event handling;
30
30
  * no EWMH support;
31
31
  * very limited ICCCM support.
32
32
 
@@ -69,12 +69,12 @@ simple example is provided below, more details are available in the
69
69
  [`RunControl` class documentation][run_control_doc].
70
70
 
71
71
  ``` ruby
72
- DMENU = 'dmenu_run -b'.freeze
73
- VT = 'urxvt'.freeze
72
+ DMENU = 'dmenu_run -b'
73
+ VT = 'urxvt'
74
74
  BROWSERS = %w[
75
75
  arora chromium firebird firefox galeon iceweasel konqueror pentadactyl
76
76
  phoenix vimperator
77
- ].freeze
77
+ ]
78
78
 
79
79
 
80
80
  modifier :mod1 # This key is added to the modifier mask for *all*
@@ -124,6 +124,217 @@ available in the [`ActionsHandler` class documentation][actions_doc]
124
124
  [actions_doc]: http://www.rubydoc.info/gems/uh-wm/Uh/WM/ActionsHandler
125
125
 
126
126
 
127
+ Extensive configuration example
128
+ -------------------------------
129
+
130
+ ``` ruby
131
+ COLORS = {
132
+ bg: 'rgb:0c/0c/0c'.freeze,
133
+ fg: 'rgb:d0/d0/d0'.freeze,
134
+ sel: 'rgb:d7/00/5f'.freeze,
135
+ hi: 'rgb:82/00/3a'.freeze
136
+ }.freeze
137
+ DMENU = ('dmenu_run -b -nb %s -nf %s -sb %s -sf %s' %
138
+ COLORS.values_at(:bg, :fg, :sel, :fg)).freeze
139
+ VT = 'urxvt'.freeze
140
+ VT_SHELL = "#{VT} -e zsh -i -c".freeze
141
+ LOCKER = 'xautolock -locknow &'.freeze
142
+ BROWSERS = %w[
143
+ arora chrome chromium firebird firefox galeon iceweasel konqueror pentadactyl
144
+ phoenix vimperator
145
+ ].freeze
146
+ DATETIME = -> { Time.new.strftime('%FT%T %a') }.freeze
147
+
148
+
149
+ worker :kqueue, timeout: 1
150
+ modifier :mod1
151
+ layout colors: COLORS, bar_status: DATETIME
152
+
153
+ key(:Q) { quit }
154
+ key(:z) { execute LOCKER }
155
+
156
+ key(:enter) { execute VT }
157
+ key(:p) { execute DMENU }
158
+
159
+ key(:c) { layout_screen_sel :succ }
160
+ key(:C) { layout_screen_set :succ }
161
+ (0..9).each { |e| key(e) { layout_view_sel e } }
162
+ (0..9).each { |e| key(e, :shift) { layout_view_set e } }
163
+ key(:w) { layout_view_sel 'www' }
164
+ key(:W) { layout_view_set 'www' }
165
+ key(:h) { layout_column_sel :pred }
166
+ key(:s) { layout_column_sel :succ }
167
+ key(:n) { layout_client_sel :pred }
168
+ key(:t) { layout_client_sel :succ }
169
+ key(:d) { layout_column_mode_toggle }
170
+ key(:N) { layout_client_swap :pred }
171
+ key(:T) { layout_client_swap :succ }
172
+ key(:H) { layout_client_column_set :pred }
173
+ key(:S) { layout_client_column_set :succ }
174
+
175
+ key(:tab) { layout_history_view_pred }
176
+
177
+ key(:e) { kill_current }
178
+
179
+ key(:apostrophe) { execute 'mocp --toggle-pause' }
180
+ key(:comma) { execute 'mixer vol -3' }
181
+ key(:period) { execute 'mixer vol +3' }
182
+ key(:Apostrophe) { execute 'mocp --seek 30' }
183
+ key(:Comma) { execute 'mocp --previous' }
184
+ key(:Period) { execute 'mocp --next' }
185
+
186
+ key(:l) { log_layout }
187
+ key(:L) { log_client }
188
+ key(:backspace) { log_separator }
189
+
190
+ if ENV['DISPLAY'] == ':42'
191
+ key(:q) { quit }
192
+ key(:f) { execute VT }
193
+ key(:F) { execute 'firefox -P test' }
194
+ end
195
+
196
+ rule BROWSERS do
197
+ layout_view_set 'www'
198
+ next unless layout.current_view.columns.size == 1
199
+ next unless layout.current_view.clients.size >= 2
200
+ next unless layout.current_view.clients.any? { |c| c.wclass =~ /\A#{VT}/i }
201
+ layout_client_column_set :succ
202
+ end
203
+
204
+ rule VT do
205
+ next unless layout.current_view.columns.size == 1
206
+ next unless layout.current_view.clients.size >= 2
207
+ if layout.current_view.clients.all? { |c| c.wclass =~ /\A#{VT}/i }
208
+ layout_client_column_set :succ
209
+ elsif layout.current_view.clients.any? { |c| c.wclass =~ /\Afirefox/i }
210
+ layout_client_column_set :pred
211
+ end
212
+ end
213
+
214
+ rule 'xephyr' do
215
+ if layout.current_view.clients.select { |c| c.wclass =~ /\Axephyr/i }.size > 1
216
+ layout_screen_set :succ
217
+ layout_view_set 7
218
+ layout_view_sel 7
219
+ layout_screen_sel :pred
220
+ layout_screen_set :succ
221
+ layout_column_mode_toggle
222
+ else
223
+ layout_client_column_set :succ
224
+ end
225
+ end
226
+
227
+ launch do
228
+ layout_screen_sel :succ
229
+
230
+ layout_view_sel '2'
231
+ execute! "#{VT_SHELL} 'tail -F ~/.uhwm.log'"
232
+
233
+ layout_view_sel '1'
234
+ execute! "#{VT_SHELL} mutt"
235
+ layout_column_mode_toggle
236
+ execute! "#{VT_SHELL} 'mtr -n foo.example; exec zsh'"
237
+ execute! "#{VT_SHELL} 'mtr -n bar.example; exec zsh'"
238
+
239
+ execute! "#{VT_SHELL} 'ssh -t foo.example zsh -i -c \\\"tmux attach -t irc\\\"; exec zsh'"
240
+ layout_client_column_set :succ
241
+
242
+ execute! "#{VT_SHELL} 'ssh -t foo.example tmux attach -t log; exec zsh'"
243
+ layout_client_column_set :succ
244
+ layout_column_mode_toggle
245
+ execute! "#{VT_SHELL} 'ssh -t bar.example tmux attach -t log; exec zsh'"
246
+ execute! "#{VT_SHELL} 'tmux attach -t log; exec zsh'"
247
+ layout_column_sel :pred
248
+
249
+ layout_screen_sel :pred
250
+
251
+ execute! "#{VT_SHELL} mutt"
252
+ execute! "#{VT_SHELL} 'vim ~/TODO; exec zsh'"
253
+ layout_client_column_set :succ
254
+ execute! VT
255
+ layout_client_column_set :succ
256
+
257
+ layout_view_sel '2'
258
+ execute! "#{VT_SHELL} 'cd ~/src/.../uh-wm; exec zsh'"
259
+ execute! "#{VT_SHELL} 'cd ~/src/.../uh-wm; exec zsh'"
260
+ layout_client_column_set :pred
261
+
262
+ layout_view_sel '4'
263
+ execute! "#{VT_SHELL} mocp; exec zsh"
264
+ execute! VT
265
+ layout_client_column_set :succ
266
+
267
+ layout_view_sel '8'
268
+ execute! "#{VT_SHELL} 'top -o res; exec zsh'"
269
+ execute! VT
270
+ layout_client_column_set :succ
271
+
272
+ layout_view_sel '1'
273
+ end if ENV['DISPLAY'] == ':0'
274
+
275
+ launch do
276
+ layout_view_sel '2'
277
+ execute! "#{VT_SHELL} 'tail -F ~/.uhwm.log'"
278
+
279
+ layout_view_sel '1'
280
+ execute! "#{VT_SHELL} 'echo hello\!; exec zsh'"
281
+ execute! VT
282
+ layout_client_column_set :succ
283
+ end if ENV['DISPLAY'] == ':42'
284
+ ```
285
+
286
+
287
+ BUGS
288
+ ----
289
+
290
+ * Signal handling is broken under certain undocumented conditions.
291
+
292
+ * Unicode is not supported everywhere (the `uh` ruby gem does not yet
293
+ support unicode text drawing).
294
+
295
+ * Column width in default layout is hard coded.
296
+
297
+
298
+ FAQ
299
+ ---
300
+
301
+ #### uhwm is stealing focus, how can I disable it?
302
+
303
+ You can't (yet). The default layout will be modified to accept an
304
+ `autofocus: false` option in a future release.
305
+
306
+ #### What are the default key bindings?
307
+
308
+ Juste one: `mod+shift+q` is bound to the `quit` action.
309
+
310
+ #### How can I implement my own layout?
311
+
312
+ A layout is a simple ruby object responding to a set of messages:
313
+ `register`, `current_client`, `suggest_geo`, `<<`, `remove`, `update`
314
+ and `expose`. No documentation is available yet, so read the source
315
+ code or the cucumber scenarios in `features/layout/protocol.feature`.
316
+
317
+ #### Can I change the default behavior ignoring current view selection?
318
+
319
+ Yes, just test for this condition in the key binding code. For
320
+ example the following code will select the last historized view (if
321
+ you are on view `"1"`, and select view `"2"` twice, the view `"1"` is
322
+ selected.
323
+
324
+ ``` ruby
325
+ # Replace the "simple" view selection key binding...
326
+ key(:m) { layout_view_sel 'my_view' }
327
+ # ...with this:
328
+ key :m do
329
+ if layout.current_view.id == 'my_view'
330
+ layout_view_sel layout.history.last_view.id
331
+ else
332
+ layout_view_sel 'my_view'
333
+ end
334
+ end
335
+ ```
336
+
337
+
127
338
 
128
339
  [badge-version-img]: https://img.shields.io/gem/v/uh-wm.svg?style=flat-square
129
340
  [badge-version-uri]: https://rubygems.org/gems/uh-wm
@@ -75,7 +75,7 @@ module Uh
75
75
  meth = layout_method m
76
76
  log "#{layout.class.name}##{meth} #{args.inspect}"
77
77
  begin
78
- layout.send(meth, *args)
78
+ layout.send meth, *args
79
79
  rescue NoMethodError
80
80
  log_error "Layout does not implement `#{meth}'"
81
81
  end
@@ -1,5 +1,5 @@
1
1
  module Uh
2
2
  module WM
3
- VERSION = '0.0.10'
3
+ VERSION = '0.0.11'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uh-wm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan