3 assert False, 'cannot create WingoCommands directly'
4
6 '''
7 Adds a new workspace to Wingo with a name Name. Note that a workspace name
8 must be unique with respect to other workspaces and must have non-zero length.
9
10 The name of the workspace that was added is returned.
11 '''
12 self._assert_arg_type('Name', Name, [basestring])
13
14 arg_str = self._gribble_arg_str([Name])
15 val = self.gribble('AddWorkspace %s' % arg_str)
16 return self._from_str('AddWorkspace', val)
17
18 - def And(self, Op1, Op2):
19 '''
20 Returns the logical AND of Op1 and Op2.
21
22 If Op1 or Op2 is not in {0, 1}, then a warning is logged and nil is returned.
23 '''
24 self._assert_arg_type('Op1', Op1, [int])
25 self._assert_arg_type('Op2', Op2, [int])
26
27 arg_str = self._gribble_arg_str([Op1, Op2])
28 val = self.gribble('And %s' % arg_str)
29 return self._from_str('And', val)
30
32 '''
33 Cycles to the next automatic tiling layout in the workspace specified by
34 Workspace.
35
36 Note that this command has no effect if the workspace is not visible.
37
38 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
39 '''
40 self._assert_arg_type('Workspace', Workspace, [int, basestring])
41
42 arg_str = self._gribble_arg_str([Workspace])
43 val = self.gribble('AutoCycle %s' % arg_str)
44 return self._from_str('AutoCycle', val)
45
47 '''
48 Switches the current window with the first master in the layout for the
49 workspace specified by Workspace.
50
51 Note that this command has no effect if the workspace is not visible.
52
53 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
54 '''
55 self._assert_arg_type('Workspace', Workspace, [int, basestring])
56
57 arg_str = self._gribble_arg_str([Workspace])
58 val = self.gribble('AutoMakeMaster %s' % arg_str)
59 return self._from_str('AutoMakeMaster', val)
60
62 '''
63 Focuses the (first) master window in the layout for the workspace specified
64 by Workspace.
65
66 Note that this command has no effect if the workspace is not visible.
67
68 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
69 '''
70 self._assert_arg_type('Workspace', Workspace, [int, basestring])
71
72 arg_str = self._gribble_arg_str([Workspace])
73 val = self.gribble('AutoMaster %s' % arg_str)
74 return self._from_str('AutoMaster', val)
75
77 '''
78 Allows one fewer master window to fit into the master split.
79
80 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
81 '''
82 self._assert_arg_type('Workspace', Workspace, [int, basestring])
83
84 arg_str = self._gribble_arg_str([Workspace])
85 val = self.gribble('AutoMastersFewer %s' % arg_str)
86 return self._from_str('AutoMastersFewer', val)
87
89 '''
90 Allows one more master window to fit into the master split.
91
92 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
93 '''
94 self._assert_arg_type('Workspace', Workspace, [int, basestring])
95
96 arg_str = self._gribble_arg_str([Workspace])
97 val = self.gribble('AutoMastersMore %s' % arg_str)
98 return self._from_str('AutoMastersMore', val)
99
101 '''
102 Moves focus to the next client in the layout.
103
104 Note that this command has no effect if the workspace is not visible.
105
106 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
107 '''
108 self._assert_arg_type('Workspace', Workspace, [int, basestring])
109
110 arg_str = self._gribble_arg_str([Workspace])
111 val = self.gribble('AutoNext %s' % arg_str)
112 return self._from_str('AutoNext', val)
113
115 '''
116 Moves focus to the next client in the layout.
117
118 Note that this command has no effect if the workspace is not visible.
119
120 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
121 '''
122 self._assert_arg_type('Workspace', Workspace, [int, basestring])
123
124 arg_str = self._gribble_arg_str([Workspace])
125 val = self.gribble('AutoPrev %s' % arg_str)
126 return self._from_str('AutoPrev', val)
127
129 '''
130 Increases or decreases the size of the master split by Amount in the layout on
131 the workspace specified by Workspace.
132
133 Amount should be a ratio between 0.0 and 1.0.
134
135 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
136 '''
137 self._assert_arg_type('Workspace', Workspace, [int, basestring])
138 self._assert_arg_type('Amount', Amount, [float])
139
140 arg_str = self._gribble_arg_str([Workspace, Amount])
141 val = self.gribble('AutoResizeMaster %s' % arg_str)
142 return self._from_str('AutoResizeMaster', val)
143
145 '''
146 Increases or decreases the size of the current window by Amount in the layout
147 on the workspace specified by Workspace.
148
149 Amount should be a ratio between 0.0 and 1.0.
150
151 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
152 '''
153 self._assert_arg_type('Workspace', Workspace, [int, basestring])
154 self._assert_arg_type('Amount', Amount, [float])
155
156 arg_str = self._gribble_arg_str([Workspace, Amount])
157 val = self.gribble('AutoResizeWindow %s' % arg_str)
158 return self._from_str('AutoResizeWindow', val)
159
161 '''
162 Switches the current window with the next window in the layout.
163
164 Note that this command has no effect if the workspace is not visible.
165
166 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
167 '''
168 self._assert_arg_type('Workspace', Workspace, [int, basestring])
169
170 arg_str = self._gribble_arg_str([Workspace])
171 val = self.gribble('AutoSwitchNext %s' % arg_str)
172 return self._from_str('AutoSwitchNext', val)
173
175 '''
176 Switches the current window with the previous window in the layout.
177
178 Note that this command has no effect if the workspace is not visible.
179
180 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
181 '''
182 self._assert_arg_type('Workspace', Workspace, [int, basestring])
183
184 arg_str = self._gribble_arg_str([Workspace])
185 val = self.gribble('AutoSwitchPrev %s' % arg_str)
186 return self._from_str('AutoSwitchPrev', val)
187
189 '''
190 Initiates automatic tiling on the workspace specified by Workspace. If tiling
191 is already active, the layout will be re-placed.
192
193 Note that this command has no effect if the workspace is not visible.
194
195 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
196 '''
197 self._assert_arg_type('Workspace', Workspace, [int, basestring])
198
199 arg_str = self._gribble_arg_str([Workspace])
200 val = self.gribble('AutoTile %s' % arg_str)
201 return self._from_str('AutoTile', val)
202
204 '''
205 Stops automatic tiling on the workspace specified by Workspace, and restores
206 windows to their position and geometry before being tiled. If tiling is not
207 active on the specified workspace, this command has no effect.
208
209 Note that this command has no effect if the workspace is not visible.
210
211 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
212 '''
213 self._assert_arg_type('Workspace', Workspace, [int, basestring])
214
215 arg_str = self._gribble_arg_str([Workspace])
216 val = self.gribble('AutoUntile %s' % arg_str)
217 return self._from_str('AutoUntile', val)
218
219 - def Close(self, Client):
220 '''
221 Closes the window specified by Client.
222
223 Client may be the window id or a substring that matches a window name.
224 '''
225 self._assert_arg_type('Client', Client, [int, basestring])
226
227 arg_str = self._gribble_arg_str([Client])
228 val = self.gribble('Close %s' % arg_str)
229 return self._from_str('Close', val)
230
232 '''
233 Activates the current choice in a cycle prompt.
234 '''
235
236 arg_str = self._gribble_arg_str([])
237 val = self.gribble('CycleClientChoose %s' % arg_str)
238 return self._from_str('CycleClientChoose', val)
239
241 '''
242 Hides (i.e., cancels) the current cycle prompt.
243 '''
244
245 arg_str = self._gribble_arg_str([])
246 val = self.gribble('CycleClientHide %s' % arg_str)
247 return self._from_str('CycleClientHide', val)
248
249 - def CycleClientNext(self, OnlyActiveWorkspace, OnlyVisible, ShowIconified):
250 '''
251 Shows the cycle prompt for clients and advances the selection to the next
252 client. If the cycle prompt is already visible, then the selection is advanced
253 to the next client.
254
255 OnlyActiveWorkspace specifies that only clients on the current workspace should
256 be listed. Valid values are "yes" or "no".
257
258 OnlyVisible specifies that only clients on visible workspaces should be listed.
259 Valid values are "yes" or "no".
260
261 ShowIconified specifies that iconified clients will be shown. Valid values are
262 "yes" or "no".
263 '''
264 self._assert_arg_type('OnlyActiveWorkspace', OnlyActiveWorkspace, [basestring])
265 self._assert_arg_type('OnlyVisible', OnlyVisible, [basestring])
266 self._assert_arg_type('ShowIconified', ShowIconified, [basestring])
267
268 arg_str = self._gribble_arg_str([OnlyActiveWorkspace, OnlyVisible, ShowIconified])
269 val = self.gribble('CycleClientNext %s' % arg_str)
270 return self._from_str('CycleClientNext', val)
271
272 - def CycleClientPrev(self, OnlyActiveWorkspace, OnlyVisible, ShowIconified):
273 '''
274 Shows the cycle prompt for clients and advances the selection to the previous
275 client. If the cycle prompt is already visible, then the selection is advanced
276 to the previous client.
277
278 OnlyActiveWorkspace specifies that only clients on the current workspace should
279 be listed. Valid values are "yes" or "no".
280
281 OnlyVisible specifies that only clients on visible workspaces should be listed.
282 Valid values are "yes" or "no".
283
284 ShowIconified specifies that iconified clients will be shown. Valid values are
285 "yes" or "no".
286 '''
287 self._assert_arg_type('OnlyActiveWorkspace', OnlyActiveWorkspace, [basestring])
288 self._assert_arg_type('OnlyVisible', OnlyVisible, [basestring])
289 self._assert_arg_type('ShowIconified', ShowIconified, [basestring])
290
291 arg_str = self._gribble_arg_str([OnlyActiveWorkspace, OnlyVisible, ShowIconified])
292 val = self.gribble('CycleClientPrev %s' % arg_str)
293 return self._from_str('CycleClientPrev', val)
294
296 '''
297 Make sure "audio_play_cmd" is set to a program that can play wav files.
298 '''
299
300 arg_str = self._gribble_arg_str([])
301 val = self.gribble('Dale %s' % arg_str)
302 return self._from_str('Dale', val)
303
305 '''
306 Always returns 0.
307 '''
308
309 arg_str = self._gribble_arg_str([])
310 val = self.gribble('False %s' % arg_str)
311 return self._from_str('False', val)
312
313 - def Float(self, Client):
314 '''
315 Floats the window specified by Client. If the window is already floating,
316 this command has no effect.
317
318 Client may be the window id or a substring that matches a window name.
319 '''
320 self._assert_arg_type('Client', Client, [int, basestring])
321
322 arg_str = self._gribble_arg_str([Client])
323 val = self.gribble('Float %s' % arg_str)
324 return self._from_str('Float', val)
325
326 - def Focus(self, Client):
327 '''
328 Focuses the window specified by Client.
329
330 Client may be the window id or a substring that matches a window name.
331 '''
332 self._assert_arg_type('Client', Client, [int, basestring])
333
334 arg_str = self._gribble_arg_str([Client])
335 val = self.gribble('Focus %s' % arg_str)
336 return self._from_str('Focus', val)
337
339 '''
340 Focuses and raises the window specified by Client.
341
342 Client may be the window id or a substring that matches a window name.
343 '''
344 self._assert_arg_type('Client', Client, [int, basestring])
345
346 arg_str = self._gribble_arg_str([Client])
347 val = self.gribble('FocusRaise %s' % arg_str)
348 return self._from_str('FocusRaise', val)
349
351 '''
352 Set the decorations of the window specified by Client to the "Borders" frame.
353
354 Client may be the window id or a substring that matches a window name.
355 '''
356 self._assert_arg_type('Client', Client, [int, basestring])
357
358 arg_str = self._gribble_arg_str([Client])
359 val = self.gribble('FrameBorders %s' % arg_str)
360 return self._from_str('FrameBorders', val)
361
363 '''
364 Set the decorations of the window specified by Client to the "Full" frame.
365
366 Client may be the window id or a substring that matches a window name.
367 '''
368 self._assert_arg_type('Client', Client, [int, basestring])
369
370 arg_str = self._gribble_arg_str([Client])
371 val = self.gribble('FrameFull %s' % arg_str)
372 return self._from_str('FrameFull', val)
373
375 '''
376 Set the decorations of the window specified by Client to the "Nada" frame.
377
378 Client may be the window id or a substring that matches a window name.
379 '''
380 self._assert_arg_type('Client', Client, [int, basestring])
381
382 arg_str = self._gribble_arg_str([Client])
383 val = self.gribble('FrameNada %s' % arg_str)
384 return self._from_str('FrameNada', val)
385
387 '''
388 Set the decorations of the window specified by Client to the "Slim" frame.
389
390 Client may be the window id or a substring that matches a window name.
391 '''
392 self._assert_arg_type('Client', Client, [int, basestring])
393
394 arg_str = self._gribble_arg_str([Client])
395 val = self.gribble('FrameSlim %s' % arg_str)
396 return self._from_str('FrameSlim', val)
397
399 '''
400 Returns the id of the currently active window. If there is no active window,
401 0 is returned.
402 '''
403
404 arg_str = self._gribble_arg_str([])
405 val = self.gribble('GetActive %s' % arg_str)
406 return self._from_str('GetActive', val)
407
409 '''
410 Returns the height of the window specified by Client, including
411 decorations. If the client id is invalid, 0 is returned.
412
413 Client may be the window id or a substring that matches a window name.
414 '''
415 self._assert_arg_type('Client', Client, [int, basestring])
416
417 arg_str = self._gribble_arg_str([Client])
418 val = self.gribble('GetClientHeight %s' % arg_str)
419 return self._from_str('GetClientHeight', val)
420
422 '''
423 Returns a list of client ids separated by new lines on the workspace specified
424 by Workspace. Clients are listed in their focus orderering, from most recently
425 focused to least recently focused.
426
427 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
428 '''
429 self._assert_arg_type('Workspace', Workspace, [int, basestring])
430
431 arg_str = self._gribble_arg_str([Workspace])
432 val = self.gribble('GetClientList %s' % arg_str)
433 return self._from_str('GetClientList', val)
434
436 '''
437 Returns the name of the window specified by Client active window.
438
439 Client may be the window id or a substring that matches a window name.
440 '''
441 self._assert_arg_type('Client', Client, [int, basestring])
442
443 arg_str = self._gribble_arg_str([Client])
444 val = self.gribble('GetClientName %s' % arg_str)
445 return self._from_str('GetClientName', val)
446
448 '''
449 Returns the type of the window specified by Client active window. A window
450 type will either be "desktop", "dock" or "normal".
451
452 Client may be the window id or a substring that matches a window name.
453 '''
454 self._assert_arg_type('Client', Client, [int, basestring])
455
456 arg_str = self._gribble_arg_str([Client])
457 val = self.gribble('GetClientType %s' % arg_str)
458 return self._from_str('GetClientType', val)
459
461 '''
462 Returns the width of the window specified by Client, including
463 decorations. If the client id is invalid, 0 is returned.
464
465 Client may be the window id or a substring that matches a window name.
466 '''
467 self._assert_arg_type('Client', Client, [int, basestring])
468
469 arg_str = self._gribble_arg_str([Client])
470 val = self.gribble('GetClientWidth %s' % arg_str)
471 return self._from_str('GetClientWidth', val)
472
474 '''
475 Returns the workspace of the window specified by Client active window.
476
477 Client may be the window id or a substring that matches a window name.
478 '''
479 self._assert_arg_type('Client', Client, [int, basestring])
480
481 arg_str = self._gribble_arg_str([Client])
482 val = self.gribble('GetClientWorkspace %s' % arg_str)
483 return self._from_str('GetClientWorkspace', val)
484
486 '''
487 Returns the relative X position of the window specified by Client, where the X
488 position refers to the left-most region of the window, including
489 decorations. Note that "relative" in this case refers to the workspace
490 that the client is on.
491
492 Relative positions can be used as arguments to MoveRelative.
493
494 If the client id is invalid, or the client is not visible, -9999 is returned.
495
496 Client may be the window id or a substring that matches a window name.
497 '''
498 self._assert_arg_type('Client', Client, [int, basestring])
499
500 arg_str = self._gribble_arg_str([Client])
501 val = self.gribble('GetClientX %s' % arg_str)
502 return self._from_str('GetClientX', val)
503
505 '''
506 Returns the relative Y position of the window specified by Client, where the Y
507 position refers to the left-most region of the window, including
508 decorations. Note that "relative" in this case refers to the workspace
509 that the client is on.
510
511 Relative positions can be used as arguments to MoveRelative.
512
513 If the client id is invalid, or the client is not visible, -9999 is returned.
514
515 Client may be the window id or a substring that matches a window name.
516 '''
517 self._assert_arg_type('Client', Client, [int, basestring])
518
519 arg_str = self._gribble_arg_str([Client])
520 val = self.gribble('GetClientY %s' % arg_str)
521 return self._from_str('GetClientY', val)
522
524 '''
525 Returns the index of the current head. Indexing starts at 0. Heads are ordered
526 by their physical position: left to right and then top to bottom.
527 '''
528
529 arg_str = self._gribble_arg_str([])
530 val = self.gribble('GetHead %s' % arg_str)
531 return self._from_str('GetHead', val)
532
534 '''
535 Gets the workable height of the head indexed at Head. If the head specified
536 is not visible, then 0 is returned.
537
538 Indexing starts at 0. Heads are ordered by their physical position: left to
539 right and then top to bottom.
540 '''
541 self._assert_arg_type('Head', Head, [int])
542
543 arg_str = self._gribble_arg_str([Head])
544 val = self.gribble('GetHeadHeight %s' % arg_str)
545 return self._from_str('GetHeadHeight', val)
546
548 '''
549 Gets the workable width of the head indexed at Head. If the head specified
550 is not visible, then 0 is returned.
551
552 Indexing starts at 0. Heads are ordered by their physical position: left to
553 right and then top to bottom.
554 '''
555 self._assert_arg_type('Head', Head, [int])
556
557 arg_str = self._gribble_arg_str([Head])
558 val = self.gribble('GetHeadWidth %s' % arg_str)
559 return self._from_str('GetHeadWidth', val)
560
562 '''
563 Returns the name of the workspace currently visible on the monitor indexed by
564 Head. Indexing starts at 0. Heads are ordered by their physical position:
565 left to right and then top to bottom.
566 '''
567 self._assert_arg_type('Head', Head, [int])
568
569 arg_str = self._gribble_arg_str([Head])
570 val = self.gribble('GetHeadWorkspace %s' % arg_str)
571 return self._from_str('GetHeadWorkspace', val)
572
574 '''
575 Returns the name of the currently active (or "default") layout on the workspace
576 specified by Workspace. Note that when a workspace is set to a tiling layout,
577 it is still possible for clients to be floating.
578
579 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
580 '''
581 self._assert_arg_type('Workspace', Workspace, [int, basestring])
582
583 arg_str = self._gribble_arg_str([Workspace])
584 val = self.gribble('GetLayout %s' % arg_str)
585 return self._from_str('GetLayout', val)
586
588 '''
589 Returns the name of the current workspace.
590 '''
591
592 arg_str = self._gribble_arg_str([])
593 val = self.gribble('GetWorkspace %s' % arg_str)
594 return self._from_str('GetWorkspace', val)
595
597 '''
598 Returns the id (the index) of the workspace specified by Workspace.
599
600 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
601 '''
602 self._assert_arg_type('Workspace', Workspace, [int, basestring])
603
604 arg_str = self._gribble_arg_str([Workspace])
605 val = self.gribble('GetWorkspaceId %s' % arg_str)
606 return self._from_str('GetWorkspaceId', val)
607
609 '''
610 Returns a list of all workspaces, in the order that they were added.
611
612 The special "Sticky" workspace is not included.
613 '''
614
615 arg_str = self._gribble_arg_str([])
616 val = self.gribble('GetWorkspaceList %s' % arg_str)
617 return self._from_str('GetWorkspaceList', val)
618
620 '''
621 Returns the name of the "next" workspace. The ordering of workspaces is
622 the order in which they were added. This might cause confusing behavior in
623 multi-head setups, since multiple workspaces can be viewable at one time.
624 '''
625
626 arg_str = self._gribble_arg_str([])
627 val = self.gribble('GetWorkspaceNext %s' % arg_str)
628 return self._from_str('GetWorkspaceNext', val)
629
631 '''
632 Returns the first non-visible workspace starting with Prefix. If the current
633 workspace starts with Prefix, then the first workspace *after* the current
634 workspace starting with Prefix will be returned.
635 '''
636 self._assert_arg_type('Prefix', Prefix, [basestring])
637
638 arg_str = self._gribble_arg_str([Prefix])
639 val = self.gribble('GetWorkspacePrefix %s' % arg_str)
640 return self._from_str('GetWorkspacePrefix', val)
641
643 '''
644 Returns the name of the "previous" workspace. The ordering of workspaces is
645 the order in which they were added. This might cause confusing behavior in
646 multi-head setups, since multiple workspaces can be viewable at one time.
647 '''
648
649 arg_str = self._gribble_arg_str([])
650 val = self.gribble('GetWorkspacePrev %s' % arg_str)
651 return self._from_str('GetWorkspacePrev', val)
652
654 '''
655 Focuses the head indexed at Head. Indexing starts at 0. Heads are ordered
656 by their physical position: left to right and then top to bottom.
657 '''
658 self._assert_arg_type('Head', Head, [int])
659
660 arg_str = self._gribble_arg_str([Head])
661 val = self.gribble('HeadFocus %s' % arg_str)
662 return self._from_str('HeadFocus', val)
663
665 '''
666 Focuses the head indexed at Head, and move the Client specified by client to
667 that head. Indexing of heads starts at 0. Heads are ordered by their physical
668 position: left to right and then top to bottom.
669
670 Client may be the window id or a substring that matches a window name.
671 '''
672 self._assert_arg_type('Head', Head, [int])
673 self._assert_arg_type('Client', Client, [int, basestring])
674
675 arg_str = self._gribble_arg_str([Head, Client])
676 val = self.gribble('HeadFocusWithClient %s' % arg_str)
677 return self._from_str('HeadFocusWithClient', val)
678
695
697 '''
698 Returns 1 if the "class" part of the WM_CLASS property on the window
699 specified by Client contains the substring specified by Class, and otherwise
700 returns 0. The search is done case insensitively.
701
702 Client may be the window id or a substring that matches a window name.
703 '''
704 self._assert_arg_type('Client', Client, [int, basestring])
705 self._assert_arg_type('Class', Class, [basestring])
706
707 arg_str = self._gribble_arg_str([Client, Class])
708 val = self.gribble('MatchClientClass %s' % arg_str)
709 return self._from_str('MatchClientClass', val)
710
712 '''
713 Returns 1 if the "instance" part of the WM_CLASS property on the window
714 specified by Client contains the substring specified by Instance, and otherwise
715 returns 0. The search is done case insensitively.
716
717 Client may be the window id or a substring that matches a window name.
718 '''
719 self._assert_arg_type('Client', Client, [int, basestring])
720 self._assert_arg_type('Instance', Instance, [basestring])
721
722 arg_str = self._gribble_arg_str([Client, Instance])
723 val = self.gribble('MatchClientInstance %s' % arg_str)
724 return self._from_str('MatchClientInstance', val)
725
727 '''
728 Returns 1 if the window specified by Client is a transient window, and
729 otherwise returns 0. A transient window usually corresponds to some kind of
730 dialog window.
731
732 Client may be the window id or a substring that matches a window name.
733 '''
734 self._assert_arg_type('Client', Client, [int, basestring])
735
736 arg_str = self._gribble_arg_str([Client])
737 val = self.gribble('MatchClientIsTransient %s' % arg_str)
738 return self._from_str('MatchClientIsTransient', val)
739
741 '''
742 Returns 1 if the name of the window specified by Client contains the substring
743 specified by Name, and otherwise returns 0. The search is done case
744 insensitively.
745
746 Client may be the window id or a substring that matches a window name.
747 '''
748 self._assert_arg_type('Client', Client, [int, basestring])
749 self._assert_arg_type('Name', Name, [basestring])
750
751 arg_str = self._gribble_arg_str([Client, Name])
752 val = self.gribble('MatchClientName %s' % arg_str)
753 return self._from_str('MatchClientName', val)
754
756 '''
757 Returns 1 if the type of the window specified by Client matches the type
758 named by Type, and otherwise returns 0.
759
760 Valid window types are "Normal", "Dock" or "Desktop".
761
762 Client may be the window id or a substring that matches a window name.
763 '''
764 self._assert_arg_type('Client', Client, [int, basestring])
765 self._assert_arg_type('Type', Type, [basestring])
766
767 arg_str = self._gribble_arg_str([Client, Type])
768 val = self.gribble('MatchClientType %s' % arg_str)
769 return self._from_str('MatchClientType', val)
770
772 '''
773 Maximizes the window specified by Client. If the window is already maximized,
774 this command has no effect.
775
776 Client may be the window id or a substring that matches a window name.
777 '''
778 self._assert_arg_type('Client', Client, [int, basestring])
779
780 arg_str = self._gribble_arg_str([Client])
781 val = self.gribble('Maximize %s' % arg_str)
782 return self._from_str('Maximize', val)
783
785 '''
786 Shows a centered prompt window with the text specified by Text. The message
787 will not disappear until it loses focus or when the confirm or cancel key
788 is pressed.
789 '''
790 self._assert_arg_type('Text', Text, [basestring])
791
792 arg_str = self._gribble_arg_str([Text])
793 val = self.gribble('Message %s' % arg_str)
794 return self._from_str('Message', val)
795
797 '''
798 Initiates a drag that allows a window to be moved with the mouse.
799
800 This is a special command that can only be assigned in Wingo's mouse
801 configuration file. Invoking this command in any other way has no effect.
802 '''
803
804 arg_str = self._gribble_arg_str([])
805 val = self.gribble('MouseMove %s' % arg_str)
806 return self._from_str('MouseMove', val)
807
809 '''
810 Initiates a drag that allows a window to be resized with the mouse.
811
812 Direction specifies how the window should be resized, and what the pointer
813 should look like. For example, if Direction is set to "BottomRight", then only
814 the width and height of the window can change---but not the x or y position.
815
816 Valid values for Direction are: Infer, Top, Bottom, Left, Right, TopLeft,
817 TopRight, BottomLeft and BottomRight. When "Infer" is used, the direction
818 is determined based on where the pointer is on the window when the drag is
819 initiated.
820
821 This is a special command that can only be assigned in Wingo's mouse
822 configuration file. Invoking this command in any other way has no effect.
823 '''
824 self._assert_arg_type('Direction', Direction, [basestring])
825
826 arg_str = self._gribble_arg_str([Direction])
827 val = self.gribble('MouseResize %s' % arg_str)
828 return self._from_str('MouseResize', val)
829
830 - def Move(self, Client, X, Y):
831 '''
832 Moves the window specified by Client to the x and y position specified by
833 X and Y. Note that the origin is located in the top left corner.
834
835 X and Y may either be pixels (integers) or ratios in the range 0.0 to
836 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
837 window's workspace's geometry.
838
839 Client may be the window id or a substring that matches a window name.
840 '''
841 self._assert_arg_type('Client', Client, [int, basestring])
842 self._assert_arg_type('X', X, [float, int])
843 self._assert_arg_type('Y', Y, [float, int])
844
845 arg_str = self._gribble_arg_str([Client, X, Y])
846 val = self.gribble('Move %s' % arg_str)
847 return self._from_str('Move', val)
848
850 '''
851 Moves the pointer to the x and y position specified by X and Y. Note the the
852 origin is located in the top left corner.
853 '''
854 self._assert_arg_type('X', X, [int])
855 self._assert_arg_type('Y', Y, [int])
856
857 arg_str = self._gribble_arg_str([X, Y])
858 val = self.gribble('MovePointer %s' % arg_str)
859 return self._from_str('MovePointer', val)
860
862 '''
863 Moves the pointer to the x and y position specified by X and Y relative to the
864 current workspace. Note the the origin is located in the top left corner of
865 the current workspace.
866
867 X and Y may either be pixels (integers) or ratios in the range 0.0 to
868 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
869 workspace's geometry.
870 '''
871 self._assert_arg_type('X', X, [float, int])
872 self._assert_arg_type('Y', Y, [float, int])
873
874 arg_str = self._gribble_arg_str([X, Y])
875 val = self.gribble('MovePointerRelative %s' % arg_str)
876 return self._from_str('MovePointerRelative', val)
877
879 '''
880 Moves the window specified by Client to the x and y position specified by
881 X and Y, relative to its workspace. Note that the origin is located in the top
882 left corner of the client's workspace.
883
884 X and Y may either be pixels (integers) or ratios in the range 0.0 to
885 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
886 window's workspace's geometry.
887
888 Client may be the window id or a substring that matches a window name.
889 '''
890 self._assert_arg_type('Client', Client, [int, basestring])
891 self._assert_arg_type('X', X, [float, int])
892 self._assert_arg_type('Y', Y, [float, int])
893
894 arg_str = self._gribble_arg_str([Client, X, Y])
895 val = self.gribble('MoveRelative %s' % arg_str)
896 return self._from_str('MoveRelative', val)
897
899 '''
900 Returns the negation of Op. When Op is 0, Not returns 1. When Op is 1, Not
901 returns 0.
902
903 If Op is not in {0, 1}, then a warning is logged and nil is returned.
904 '''
905 self._assert_arg_type('Op', Op, [int])
906
907 arg_str = self._gribble_arg_str([Op])
908 val = self.gribble('Not %s' % arg_str)
909 return self._from_str('Not', val)
910
911 - def Or(self, Op1, Op2):
912 '''
913 Returns the logical OR of Op1 and Op2.
914
915 If Op1 or Op2 is not in {0, 1}, then a warning is logged and nil is returned.
916 '''
917 self._assert_arg_type('Op1', Op1, [int])
918 self._assert_arg_type('Op2', Op2, [int])
919
920 arg_str = self._gribble_arg_str([Op1, Op2])
921 val = self.gribble('Or %s' % arg_str)
922 return self._from_str('Or', val)
923
925 '''
926 Stops Wingo.
927 '''
928
929 arg_str = self._gribble_arg_str([])
930 val = self.gribble('Quit %s' % arg_str)
931 return self._from_str('Quit', val)
932
933 - def Raise(self, Client):
934 '''
935 Raises the window specified by Client to the top of its layer.
936
937 Client may be the window id or a substring that matches a window name.
938 '''
939 self._assert_arg_type('Client', Client, [int, basestring])
940
941 arg_str = self._gribble_arg_str([Client])
942 val = self.gribble('Raise %s' % arg_str)
943 return self._from_str('Raise', val)
944
946 '''
947 Removes the workspace specified by Workspace. Note that a workspace can *only*
948 be removed if it is empty (i.e., does not contain any windows).
949
950 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
951 '''
952 self._assert_arg_type('Workspace', Workspace, [int, basestring])
953
954 arg_str = self._gribble_arg_str([Workspace])
955 val = self.gribble('RemoveWorkspace %s' % arg_str)
956 return self._from_str('RemoveWorkspace', val)
957
959 '''
960 Renames the workspace specified by Workspace to the name in NewName.
961
962 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
963 NewName can only be a string.
964 '''
965 self._assert_arg_type('Workspace', Workspace, [int, basestring])
966 self._assert_arg_type('NewName', NewName, [basestring])
967
968 arg_str = self._gribble_arg_str([Workspace, NewName])
969 val = self.gribble('RenameWorkspace %s' % arg_str)
970 return self._from_str('RenameWorkspace', val)
971
972 - def Resize(self, Client, Width, Height):
973 '''
974 Resizes the window specified by Client to some width and height specified by
975 Width and Height.
976
977 Width and Height may either be pixels (integers) or ratios in the range 0.0 to
978 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
979 window's workspace's geometry.
980
981 Client may be the window id or a substring that matches a window name.
982 '''
983 self._assert_arg_type('Client', Client, [int, basestring])
984 self._assert_arg_type('Width', Width, [float, int])
985 self._assert_arg_type('Height', Height, [float, int])
986
987 arg_str = self._gribble_arg_str([Client, Width, Height])
988 val = self.gribble('Resize %s' % arg_str)
989 return self._from_str('Resize', val)
990
992 '''
993 Restarts Wingo in place using exec. This should be used to reload Wingo
994 after you've made changes to its configuration.
995 '''
996
997 arg_str = self._gribble_arg_str([])
998 val = self.gribble('Restart %s' % arg_str)
999 return self._from_str('Restart', val)
1000
1001 - def SelectClient(self, TabCompletion, OnlyActiveWorkspace, OnlyVisible, ShowIconified):
1002 '''
1003 Shows a centered prompt window with a list of clients satisfying the arguments
1004 provided.
1005
1006 OnlyActiveWorkspace specifies that only clients on the current workspace should
1007 be listed. Valid values are "yes" or "no".
1008
1009 OnlyVisible specifies that only clients on visible workspaces should be listed.
1010 Valid values are "yes" or "no".
1011
1012 ShowIconified specifies that iconified clients will be shown. Valid values are
1013 "yes" or "no".
1014
1015 TabCompletetion can be set to either "Prefix", "Any" or "Multiple". When it's
1016 set to "Prefix", the clients can be searched by a prefix matching string. When
1017 it's set to "Any", the clients can be searched by a substring matching string.
1018 When it's set to "Multiple", the clients can be searched by multiple space-
1019 separated substring matching strings.
1020
1021 This command may be used as a sub-command to pass a particular client to
1022 another command.
1023 '''
1024 self._assert_arg_type('TabCompletion', TabCompletion, [basestring])
1025 self._assert_arg_type('OnlyActiveWorkspace', OnlyActiveWorkspace, [basestring])
1026 self._assert_arg_type('OnlyVisible', OnlyVisible, [basestring])
1027 self._assert_arg_type('ShowIconified', ShowIconified, [basestring])
1028
1029 arg_str = self._gribble_arg_str([TabCompletion, OnlyActiveWorkspace, OnlyVisible, ShowIconified])
1030 val = self.gribble('SelectClient %s' % arg_str)
1031 return self._from_str('SelectClient', val)
1032
1034 '''
1035 Shows a centered prompt window with a list of all workspaces.
1036
1037 TabCompletetion can be set to either "Prefix", "Any" or "Multiple". When it's
1038 set to "Prefix", the clients can be searched by a prefix matching string. When
1039 it's set to "Any", the clients can be searched by a substring matching string.
1040 When it's set to "Multiple", the clients can be searched by multiple space-
1041 separated substring matching strings.
1042
1043 This command may be used as a sub-command to pass a particular workspace to
1044 another command.
1045 '''
1046 self._assert_arg_type('TabCompletion', TabCompletion, [basestring])
1047
1048 arg_str = self._gribble_arg_str([TabCompletion])
1049 val = self.gribble('SelectWorkspace %s' % arg_str)
1050 return self._from_str('SelectWorkspace', val)
1051
1053 '''
1054 Sets the current layout of the workspace specified by Workspace to the layout
1055 named by Name. If a layout with name Name does not exist, this command has
1056 no effect.
1057
1058 Note that this command has no effect if the workspace is not visible.
1059
1060 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1061 '''
1062 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1063 self._assert_arg_type('Name', Name, [basestring])
1064
1065 arg_str = self._gribble_arg_str([Workspace, Name])
1066 val = self.gribble('SetLayout %s' % arg_str)
1067 return self._from_str('SetLayout', val)
1068
1070 '''
1071 Sets the opacity of the window specified by Client to the opacity level
1072 specified by Opacity.
1073
1074 This command won't have any effect unless you're running a compositing manager
1075 like compton or cairo-compmgr.
1076
1077 Client may be the window id or a substring that matches a window name.
1078
1079 Opacity should be a float in the range 0.0 to 1.0, inclusive, where 0.0 is
1080 completely transparent and 1.0 is completely opaque.
1081 '''
1082 self._assert_arg_type('Client', Client, [int, basestring])
1083 self._assert_arg_type('Opacity', Opacity, [float])
1084
1085 arg_str = self._gribble_arg_str([Client, Opacity])
1086 val = self.gribble('SetOpacity %s' % arg_str)
1087 return self._from_str('SetOpacity', val)
1088
1089 - def Shell(self, Command):
1090 '''
1091 Attempts to execute the shell command specified by Command. If an error occurs,
1092 it will be logged to Wingo's stderr.
1093
1094 Note that the parser for translating shell commands to something acceptable
1095 for Go's os/exec package is fairly primitive. Therefore, this should not be
1096 considered as a suitable replacement for similar utilities (like gmrun or
1097 xbindkeys).
1098 '''
1099 self._assert_arg_type('Command', Command, [basestring])
1100
1101 arg_str = self._gribble_arg_str([Command])
1102 val = self.gribble('Shell %s' % arg_str)
1103 return self._from_str('Shell', val)
1104
1106 '''
1107 Toggles whether the window specified by Client should be forced into the
1108 floating layout. A window forced into the floating layout CANNOT be tiled.
1109
1110 Client may be the window id or a substring that matches a window name.
1111 '''
1112 self._assert_arg_type('Client', Client, [int, basestring])
1113
1114 arg_str = self._gribble_arg_str([Client])
1115 val = self.gribble('ToggleFloating %s' % arg_str)
1116 return self._from_str('ToggleFloating', val)
1117
1119 '''
1120 Iconifies (minimizes) or deiconifies (unminimizes) the window specified by
1121 Client.
1122
1123 Client may be the window id or a substring that matches a window name.
1124 '''
1125 self._assert_arg_type('Client', Client, [int, basestring])
1126
1127 arg_str = self._gribble_arg_str([Client])
1128 val = self.gribble('ToggleIconify %s' % arg_str)
1129 return self._from_str('ToggleIconify', val)
1130
1132 '''
1133 Maximizes or restores the window specified by Client.
1134
1135 Client may be the window id or a substring that matches a window name.
1136 '''
1137 self._assert_arg_type('Client', Client, [int, basestring])
1138
1139 arg_str = self._gribble_arg_str([Client])
1140 val = self.gribble('ToggleMaximize %s' % arg_str)
1141 return self._from_str('ToggleMaximize', val)
1142
1144 '''
1145 Toggles the layer of the window specified by Client from normal to above. When
1146 a window is in the "above" layer, it will always be above other (normal)
1147 clients.
1148
1149 Client may be the window id or a substring that matches a window name.
1150 '''
1151 self._assert_arg_type('Client', Client, [int, basestring])
1152
1153 arg_str = self._gribble_arg_str([Client])
1154 val = self.gribble('ToggleStackAbove %s' % arg_str)
1155 return self._from_str('ToggleStackAbove', val)
1156
1158 '''
1159 Toggles the layer of the window specified by Client from normal to below. When
1160 a window is in the "below" layer, it will always be below other (normal)
1161 clients.
1162
1163 Client may be the window id or a substring that matches a window name.
1164 '''
1165 self._assert_arg_type('Client', Client, [int, basestring])
1166
1167 arg_str = self._gribble_arg_str([Client])
1168 val = self.gribble('ToggleStackBelow %s' % arg_str)
1169 return self._from_str('ToggleStackBelow', val)
1170
1172 '''
1173 Toggles the sticky status of the window specified by Client. When a window is
1174 sticky, it will always be visible unless iconified. (i.e., it does not belong
1175 to any particular workspace.)
1176
1177 Client may be the window id or a substring that matches a window name.
1178 '''
1179 self._assert_arg_type('Client', Client, [int, basestring])
1180
1181 arg_str = self._gribble_arg_str([Client])
1182 val = self.gribble('ToggleSticky %s' % arg_str)
1183 return self._from_str('ToggleSticky', val)
1184
1186 '''
1187 Always returns 1.
1188 '''
1189
1190 arg_str = self._gribble_arg_str([])
1191 val = self.gribble('True %s' % arg_str)
1192 return self._from_str('True', val)
1193
1195 '''
1196 Unfloats the window specified by Client. If the window is not floating,
1197 this command has no effect.
1198
1199 Client may be the window id or a substring that matches a window name.
1200 '''
1201 self._assert_arg_type('Client', Client, [int, basestring])
1202
1203 arg_str = self._gribble_arg_str([Client])
1204 val = self.gribble('Unfloat %s' % arg_str)
1205 return self._from_str('Unfloat', val)
1206
1208 '''
1209 Unmaximizes the window specified by Client. If the window is not maximized,
1210 this command has no effect.
1211
1212 Client may be the window id or a substring that matches a window name.
1213 '''
1214 self._assert_arg_type('Client', Client, [int, basestring])
1215
1216 arg_str = self._gribble_arg_str([Client])
1217 val = self.gribble('Unmaximize %s' % arg_str)
1218 return self._from_str('Unmaximize', val)
1219
1221 '''
1222 Executes a series of Wingo commands specified by Commands. If an error occurs
1223 while executing the command, it will be shown in a popup message.
1224 '''
1225 self._assert_arg_type('Commands', Commands, [basestring])
1226
1227 arg_str = self._gribble_arg_str([Commands])
1228 val = self.gribble('WingoExec %s' % arg_str)
1229 return self._from_str('WingoExec', val)
1230
1232 '''
1233 Shows the usage information for a particular command specified by CommandName.
1234 '''
1235 self._assert_arg_type('CommandName', CommandName, [basestring])
1236
1237 arg_str = self._gribble_arg_str([CommandName])
1238 val = self.gribble('WingoHelp %s' % arg_str)
1239 return self._from_str('WingoHelp', val)
1240
1242 '''
1243 Sets the current workspace to the one specified by Workspace.
1244
1245 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1246 '''
1247 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1248
1249 arg_str = self._gribble_arg_str([Workspace])
1250 val = self.gribble('Workspace %s' % arg_str)
1251 return self._from_str('Workspace', val)
1252
1254 '''
1255 Sets the current workspace to the one specified by Workspace in a greedy
1256 fashion.
1257
1258 A greedy switch *always* brings the specified workspace to the
1259 currently focused head. (N.B. Greedy is only different when switching between
1260 two visible workspaces.)
1261
1262 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1263 '''
1264 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1265
1266 arg_str = self._gribble_arg_str([Workspace])
1267 val = self.gribble('WorkspaceGreedy %s' % arg_str)
1268 return self._from_str('WorkspaceGreedy', val)
1269
1271 '''
1272 Sets the current workspace to the workspace specified by Workspace in a greedy
1273 fashion, and moves the window specified by Client to that workspace.
1274
1275 A greedy switch *always* brings the specified workspace to the
1276 currently focused head. (N.B. Greedy is only different when switching between
1277 two visible workspaces.)
1278
1279 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1280
1281 Client may be the window id or a substring that matches a window name.
1282 '''
1283 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1284 self._assert_arg_type('Client', Client, [int, basestring])
1285
1286 arg_str = self._gribble_arg_str([Workspace, Client])
1287 val = self.gribble('WorkspaceGreedyWithClient %s' % arg_str)
1288 return self._from_str('WorkspaceGreedyWithClient', val)
1289
1291 '''
1292 Retrieves the head index of the workspace specified by Workspace. If the
1293 workspace is not visible, then -1 is returned.
1294
1295 Head indexing starts at 0. Heads are ordered by their physical position: left
1296 to right and then top to bottom.
1297
1298 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1299 '''
1300 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1301
1302 arg_str = self._gribble_arg_str([Workspace])
1303 val = self.gribble('WorkspaceHead %s' % arg_str)
1304 return self._from_str('WorkspaceHead', val)
1305
1307 '''
1308 Sends the window specified by Client to the workspace specified by Workspace.
1309
1310 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1311
1312 Client may be the window id or a substring that matches a window name.
1313 '''
1314 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1315 self._assert_arg_type('Client', Client, [int, basestring])
1316
1317 arg_str = self._gribble_arg_str([Workspace, Client])
1318 val = self.gribble('WorkspaceSendClient %s' % arg_str)
1319 return self._from_str('WorkspaceSendClient', val)
1320
1322 '''
1323 Sets the workspace specified by Workspace to appear on the head specified by
1324 the Head index.
1325
1326 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1327
1328 Head indexing starts at 0. Heads are ordered by their physical position: left
1329 to right and then top to bottom.
1330 '''
1331 self._assert_arg_type('Head', Head, [int])
1332 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1333
1334 arg_str = self._gribble_arg_str([Head, Workspace])
1335 val = self.gribble('WorkspaceToHead %s' % arg_str)
1336 return self._from_str('WorkspaceToHead', val)
1337
1339 '''
1340 Sets the current workspace to the workspace specified by Workspace, and moves
1341 the window specified by Client to that workspace.
1342
1343 Workspace may be a workspace index (integer) starting at 0, or a workspace name.
1344
1345 Client may be the window id or a substring that matches a window name.
1346 '''
1347 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1348 self._assert_arg_type('Client', Client, [int, basestring])
1349
1350 arg_str = self._gribble_arg_str([Workspace, Client])
1351 val = self.gribble('WorkspaceWithClient %s' % arg_str)
1352 return self._from_str('WorkspaceWithClient', val)
1353