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