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 Deiconifies (unminimizes) the window specified by Client. If the window
320 is already deiconified, this command has no effect.
321
322 Client may be the window id or a substring that matches a window name.
323 '''
324 self._assert_arg_type('Client', Client, [int, basestring])
325
326 arg_str = self._gribble_arg_str([Client])
327 val = self.gribble('Deiconify %s' % arg_str)
328 return self._from_str('Deiconify', val)
329
331 '''
332 Always returns 0.
333 '''
334
335 arg_str = self._gribble_arg_str([])
336 val = self.gribble('False %s' % arg_str)
337 return self._from_str('False', val)
338
339 - def Float(self, Client):
340 '''
341 Floats the window specified by Client. If the window is already floating,
342 this command has no effect.
343
344 Client may be the window id or a substring that matches a window name.
345 '''
346 self._assert_arg_type('Client', Client, [int, basestring])
347
348 arg_str = self._gribble_arg_str([Client])
349 val = self.gribble('Float %s' % arg_str)
350 return self._from_str('Float', val)
351
352 - def Focus(self, Client):
353 '''
354 Focuses the window specified by Client.
355
356 Client may be the window id or a substring that matches a window name.
357 '''
358 self._assert_arg_type('Client', Client, [int, basestring])
359
360 arg_str = self._gribble_arg_str([Client])
361 val = self.gribble('Focus %s' % arg_str)
362 return self._from_str('Focus', val)
363
365 '''
366 Focuses and raises the window specified by Client.
367
368 Client may be the window id or a substring that matches a window name.
369 '''
370 self._assert_arg_type('Client', Client, [int, basestring])
371
372 arg_str = self._gribble_arg_str([Client])
373 val = self.gribble('FocusRaise %s' % arg_str)
374 return self._from_str('FocusRaise', val)
375
377 '''
378 Set the decorations of the window specified by Client to the "Borders" frame.
379
380 Client may be the window id or a substring that matches a window name.
381 '''
382 self._assert_arg_type('Client', Client, [int, basestring])
383
384 arg_str = self._gribble_arg_str([Client])
385 val = self.gribble('FrameBorders %s' % arg_str)
386 return self._from_str('FrameBorders', val)
387
389 '''
390 Set the decorations of the window specified by Client to the "Full" frame.
391
392 Client may be the window id or a substring that matches a window name.
393 '''
394 self._assert_arg_type('Client', Client, [int, basestring])
395
396 arg_str = self._gribble_arg_str([Client])
397 val = self.gribble('FrameFull %s' % arg_str)
398 return self._from_str('FrameFull', val)
399
401 '''
402 Set the decorations of the window specified by Client to the "Nada" frame.
403
404 Client may be the window id or a substring that matches a window name.
405 '''
406 self._assert_arg_type('Client', Client, [int, basestring])
407
408 arg_str = self._gribble_arg_str([Client])
409 val = self.gribble('FrameNada %s' % arg_str)
410 return self._from_str('FrameNada', val)
411
413 '''
414 Set the decorations of the window specified by Client to the "Slim" frame.
415
416 Client may be the window id or a substring that matches a window name.
417 '''
418 self._assert_arg_type('Client', Client, [int, basestring])
419
420 arg_str = self._gribble_arg_str([Client])
421 val = self.gribble('FrameSlim %s' % arg_str)
422 return self._from_str('FrameSlim', val)
423
425 '''
426 Returns the id of the currently active window. If there is no active window,
427 0 is returned.
428 '''
429
430 arg_str = self._gribble_arg_str([])
431 val = self.gribble('GetActive %s' % arg_str)
432 return self._from_str('GetActive', val)
433
435 '''
436 Returns a list of all client ids separated by new lines. Clients are listed
437 in the order in which they were managed, starting with the oldest client.
438 '''
439
440 arg_str = self._gribble_arg_str([])
441 val = self.gribble('GetAllClients %s' % arg_str)
442 return self._from_str('GetAllClients', val)
443
445 '''
446 Returns the height of the window specified by Client, including
447 decorations. If the client id is invalid, 0 is returned.
448
449 Client may be the window id or a substring that matches a window name.
450 '''
451 self._assert_arg_type('Client', Client, [int, basestring])
452
453 arg_str = self._gribble_arg_str([Client])
454 val = self.gribble('GetClientHeight %s' % arg_str)
455 return self._from_str('GetClientHeight', val)
456
458 '''
459 Returns a list of client ids separated by new lines on the workspace specified
460 by Workspace. Clients are listed in their focus orderering, from most recently
461 focused to least recently focused.
462
463 Workspace may be a workspace index (integer) starting at 0, or a workspace
464 name.
465 '''
466 self._assert_arg_type('Workspace', Workspace, [int, basestring])
467
468 arg_str = self._gribble_arg_str([Workspace])
469 val = self.gribble('GetClientList %s' % arg_str)
470 return self._from_str('GetClientList', val)
471
473 '''
474 Returns the name of the window specified by Client active window.
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('GetClientName %s' % arg_str)
482 return self._from_str('GetClientName', val)
483
485 '''
486 Returns a list of states that the client is in. These states are in
487 correspondence with the possible values of the _NET_WM_STATE property.
488 The following states may appear in the list: STICKY, MAXIMIZED_VERT,
489 MAXIMIZED_HORZ, SKIP_TASKBAR, SKIP_PAGER, HIDDEN, FULLSCREEN,
490 ABOVE, BELOW, DEMANDS_ATTENTION and FOCUSED.
491
492 More details can be found here: http://goo.gl/FHdjl
493
494 Client may be the window id or a substring that matches a window name.
495 '''
496 self._assert_arg_type('Client', Client, [int, basestring])
497
498 arg_str = self._gribble_arg_str([Client])
499 val = self.gribble('GetClientStatesList %s' % arg_str)
500 return self._from_str('GetClientStatesList', val)
501
503 '''
504 Returns the type of the window specified by Client active window. A window
505 type will either be "desktop", "dock" or "normal".
506
507 Client may be the window id or a substring that matches a window name.
508 '''
509 self._assert_arg_type('Client', Client, [int, basestring])
510
511 arg_str = self._gribble_arg_str([Client])
512 val = self.gribble('GetClientType %s' % arg_str)
513 return self._from_str('GetClientType', val)
514
516 '''
517 Returns the width of the window specified by Client, including
518 decorations. If the client id is invalid, 0 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('GetClientWidth %s' % arg_str)
526 return self._from_str('GetClientWidth', val)
527
529 '''
530 Returns the workspace of the window specified by Client active window.
531
532 Client may be the window id or a substring that matches a window name.
533 '''
534 self._assert_arg_type('Client', Client, [int, basestring])
535
536 arg_str = self._gribble_arg_str([Client])
537 val = self.gribble('GetClientWorkspace %s' % arg_str)
538 return self._from_str('GetClientWorkspace', val)
539
541 '''
542 Returns the relative X position of the window specified by Client, where the X
543 position refers to the left-most region of the window, including
544 decorations. Note that "relative" in this case refers to the workspace
545 that the client is on.
546
547 Relative positions can be used as arguments to MoveRelative.
548
549 If the client id is invalid, or the client is not visible, -9999 is returned.
550
551 Client may be the window id or a substring that matches a window name.
552 '''
553 self._assert_arg_type('Client', Client, [int, basestring])
554
555 arg_str = self._gribble_arg_str([Client])
556 val = self.gribble('GetClientX %s' % arg_str)
557 return self._from_str('GetClientX', val)
558
560 '''
561 Returns the relative Y position of the window specified by Client, where the Y
562 position refers to the left-most region of the window, including
563 decorations. Note that "relative" in this case refers to the workspace
564 that the client is on.
565
566 Relative positions can be used as arguments to MoveRelative.
567
568 If the client id is invalid, or the client is not visible, -9999 is returned.
569
570 Client may be the window id or a substring that matches a window name.
571 '''
572 self._assert_arg_type('Client', Client, [int, basestring])
573
574 arg_str = self._gribble_arg_str([Client])
575 val = self.gribble('GetClientY %s' % arg_str)
576 return self._from_str('GetClientY', val)
577
579 '''
580 Returns the index of the current head. Indexing starts at 0. Heads are ordered
581 by their physical position: left to right and then top to bottom.
582 '''
583
584 arg_str = self._gribble_arg_str([])
585 val = self.gribble('GetHead %s' % arg_str)
586 return self._from_str('GetHead', val)
587
589 '''
590 Gets the workable height of the head indexed at Head. If the head specified
591 is not visible, then 0 is returned.
592
593 Indexing starts at 0. Heads are ordered by their physical position: left to
594 right and then top to bottom.
595 '''
596 self._assert_arg_type('Head', Head, [int])
597
598 arg_str = self._gribble_arg_str([Head])
599 val = self.gribble('GetHeadHeight %s' % arg_str)
600 return self._from_str('GetHeadHeight', val)
601
603 '''
604 Gets the workable width of the head indexed at Head. If the head specified
605 is not visible, then 0 is returned.
606
607 Indexing starts at 0. Heads are ordered by their physical position: left to
608 right and then top to bottom.
609 '''
610 self._assert_arg_type('Head', Head, [int])
611
612 arg_str = self._gribble_arg_str([Head])
613 val = self.gribble('GetHeadWidth %s' % arg_str)
614 return self._from_str('GetHeadWidth', val)
615
617 '''
618 Returns the name of the workspace currently visible on the monitor indexed by
619 Head. Indexing starts at 0. Heads are ordered by their physical position:
620 left to right and then top to bottom.
621 '''
622 self._assert_arg_type('Head', Head, [int])
623
624 arg_str = self._gribble_arg_str([Head])
625 val = self.gribble('GetHeadWorkspace %s' % arg_str)
626 return self._from_str('GetHeadWorkspace', val)
627
629 '''
630 Returns the name of the currently active (or "default") layout on the workspace
631 specified by Workspace. Note that when a workspace is set to a tiling layout,
632 it is still possible for clients to be floating.
633
634 Workspace may be a workspace index (integer) starting at 0, or a workspace
635 name.
636 '''
637 self._assert_arg_type('Workspace', Workspace, [int, basestring])
638
639 arg_str = self._gribble_arg_str([Workspace])
640 val = self.gribble('GetLayout %s' % arg_str)
641 return self._from_str('GetLayout', val)
642
644 '''
645 Returns the number of active Heads.
646 '''
647
648 arg_str = self._gribble_arg_str([])
649 val = self.gribble('GetNumHeads %s' % arg_str)
650 return self._from_str('GetNumHeads', val)
651
653 '''
654 Returns the number of Heads connected. This number may be greater
655 than the number returned by GetNumHeads.
656 '''
657
658 arg_str = self._gribble_arg_str([])
659 val = self.gribble('GetNumHeadsConnected %s' % arg_str)
660 return self._from_str('GetNumHeadsConnected', val)
661
663 '''
664 Returns the name of the current workspace.
665 '''
666
667 arg_str = self._gribble_arg_str([])
668 val = self.gribble('GetWorkspace %s' % arg_str)
669 return self._from_str('GetWorkspace', val)
670
672 '''
673 Returns the id (the index) of the workspace specified by Workspace.
674
675 Workspace may be a workspace index (integer) starting at 0, or a workspace
676 name.
677 '''
678 self._assert_arg_type('Workspace', Workspace, [int, basestring])
679
680 arg_str = self._gribble_arg_str([Workspace])
681 val = self.gribble('GetWorkspaceId %s' % arg_str)
682 return self._from_str('GetWorkspaceId', val)
683
685 '''
686 Returns a list of all workspaces, in the order that they were added.
687
688 The special "Sticky" workspace is not included.
689 '''
690
691 arg_str = self._gribble_arg_str([])
692 val = self.gribble('GetWorkspaceList %s' % arg_str)
693 return self._from_str('GetWorkspaceList', val)
694
696 '''
697 Returns the name of the "next" workspace. The ordering of workspaces is
698 the order in which they were added. This might cause confusing behavior in
699 multi-head setups, since multiple workspaces can be viewable at one time.
700 '''
701
702 arg_str = self._gribble_arg_str([])
703 val = self.gribble('GetWorkspaceNext %s' % arg_str)
704 return self._from_str('GetWorkspaceNext', val)
705
707 '''
708 Returns the first non-visible workspace starting with Prefix. If the current
709 workspace starts with Prefix, then the first workspace *after* the current
710 workspace starting with Prefix will be returned.
711 '''
712 self._assert_arg_type('Prefix', Prefix, [basestring])
713
714 arg_str = self._gribble_arg_str([Prefix])
715 val = self.gribble('GetWorkspacePrefix %s' % arg_str)
716 return self._from_str('GetWorkspacePrefix', val)
717
719 '''
720 Returns the name of the "previous" workspace. The ordering of workspaces is
721 the order in which they were added. This might cause confusing behavior in
722 multi-head setups, since multiple workspaces can be viewable at one time.
723 '''
724
725 arg_str = self._gribble_arg_str([])
726 val = self.gribble('GetWorkspacePrev %s' % arg_str)
727 return self._from_str('GetWorkspacePrev', val)
728
730 '''
731 Cycles focus to the next head, ordered by index. Heads are ordered
732 by their physical position: left to right and then top to bottom.
733 '''
734
735 arg_str = self._gribble_arg_str([])
736 val = self.gribble('HeadCycle %s' % arg_str)
737 return self._from_str('HeadCycle', val)
738
740 '''
741 Focuses the head indexed at Head. Indexing starts at 0. Heads are ordered
742 by their physical position: left to right and then top to bottom.
743 '''
744 self._assert_arg_type('Head', Head, [int])
745
746 arg_str = self._gribble_arg_str([Head])
747 val = self.gribble('HeadFocus %s' % arg_str)
748 return self._from_str('HeadFocus', val)
749
751 '''
752 Focuses the head indexed at Head, and move the Client specified by client to
753 that head. Indexing of heads starts at 0. Heads are ordered by their physical
754 position: left to right and then top to bottom.
755
756 Client may be the window id or a substring that matches a window name.
757 '''
758 self._assert_arg_type('Head', Head, [int])
759 self._assert_arg_type('Client', Client, [int, basestring])
760
761 arg_str = self._gribble_arg_str([Head, Client])
762 val = self.gribble('HeadFocusWithClient %s' % arg_str)
763 return self._from_str('HeadFocusWithClient', val)
764
766 '''
767 Sets the appropriate flags so that the window specified by Client is
768 hidden from panels and pagers.
769
770 Client may be the window id or a substring that matches a window name.
771 '''
772 self._assert_arg_type('Client', Client, [int, basestring])
773
774 arg_str = self._gribble_arg_str([Client])
775 val = self.gribble('HideClientFromPanels %s' % arg_str)
776 return self._from_str('HideClientFromPanels', val)
777
779 '''
780 Iconifies (minimizes) the window specified by Client. If the window
781 is already iconified, this command has no effect.
782
783 Client may be the window id or a substring that matches a window name.
784 '''
785 self._assert_arg_type('Client', Client, [int, basestring])
786
787 arg_str = self._gribble_arg_str([Client])
788 val = self.gribble('Iconify %s' % arg_str)
789 return self._from_str('Iconify', val)
790
807
809 '''
810 Returns 1 if the "class" part of the WM_CLASS property on the window
811 specified by Client contains the substring specified by Class, and otherwise
812 returns 0. The search is done case insensitively.
813
814 Client may be the window id or a substring that matches a window name.
815 '''
816 self._assert_arg_type('Client', Client, [int, basestring])
817 self._assert_arg_type('Class', Class, [basestring])
818
819 arg_str = self._gribble_arg_str([Client, Class])
820 val = self.gribble('MatchClientClass %s' % arg_str)
821 return self._from_str('MatchClientClass', val)
822
824 '''
825 Returns 1 if the "instance" part of the WM_CLASS property on the window
826 specified by Client contains the substring specified by Instance, and otherwise
827 returns 0. The search is done case insensitively.
828
829 Client may be the window id or a substring that matches a window name.
830 '''
831 self._assert_arg_type('Client', Client, [int, basestring])
832 self._assert_arg_type('Instance', Instance, [basestring])
833
834 arg_str = self._gribble_arg_str([Client, Instance])
835 val = self.gribble('MatchClientInstance %s' % arg_str)
836 return self._from_str('MatchClientInstance', val)
837
839 '''
840 Returns 1 if the window specified by Client is a transient window, and
841 otherwise returns 0. A transient window usually corresponds to some kind of
842 dialog window.
843
844 Client may be the window id or a substring that matches a window name.
845 '''
846 self._assert_arg_type('Client', Client, [int, basestring])
847
848 arg_str = self._gribble_arg_str([Client])
849 val = self.gribble('MatchClientIsTransient %s' % arg_str)
850 return self._from_str('MatchClientIsTransient', val)
851
853 '''
854 Returns 1 if the window specified by Client is mapped or not.
855
856 Client may be the window id or a substring that matches a window name.
857 '''
858 self._assert_arg_type('Client', Client, [int, basestring])
859
860 arg_str = self._gribble_arg_str([Client])
861 val = self.gribble('MatchClientMapped %s' % arg_str)
862 return self._from_str('MatchClientMapped', val)
863
865 '''
866 Returns 1 if the name of the window specified by Client contains the substring
867 specified by Name, and otherwise returns 0. The search is done case
868 insensitively.
869
870 Client may be the window id or a substring that matches a window name.
871 '''
872 self._assert_arg_type('Client', Client, [int, basestring])
873 self._assert_arg_type('Name', Name, [basestring])
874
875 arg_str = self._gribble_arg_str([Client, Name])
876 val = self.gribble('MatchClientName %s' % arg_str)
877 return self._from_str('MatchClientName', val)
878
880 '''
881 Returns 1 if the type of the window specified by Client matches the type
882 named by Type, and otherwise returns 0.
883
884 Valid window types are "Normal", "Dock" or "Desktop".
885
886 Client may be the window id or a substring that matches a window name.
887 '''
888 self._assert_arg_type('Client', Client, [int, basestring])
889 self._assert_arg_type('Type', Type, [basestring])
890
891 arg_str = self._gribble_arg_str([Client, Type])
892 val = self.gribble('MatchClientType %s' % arg_str)
893 return self._from_str('MatchClientType', val)
894
896 '''
897 Maximizes the window specified by Client. If the window is already maximized,
898 this command has no effect.
899
900 Client may be the window id or a substring that matches a window name.
901 '''
902 self._assert_arg_type('Client', Client, [int, basestring])
903
904 arg_str = self._gribble_arg_str([Client])
905 val = self.gribble('Maximize %s' % arg_str)
906 return self._from_str('Maximize', val)
907
909 '''
910 Shows a centered prompt window with the text specified by Text. The message
911 will not disappear until it loses focus or when the confirm or cancel key
912 is pressed.
913 '''
914 self._assert_arg_type('Text', Text, [basestring])
915
916 arg_str = self._gribble_arg_str([Text])
917 val = self.gribble('Message %s' % arg_str)
918 return self._from_str('Message', val)
919
921 '''
922 Initiates a drag that allows a window to be moved with the mouse.
923
924 This is a special command that can only be assigned in Wingo's mouse
925 configuration file. Invoking this command in any other way has no effect.
926 '''
927
928 arg_str = self._gribble_arg_str([])
929 val = self.gribble('MouseMove %s' % arg_str)
930 return self._from_str('MouseMove', val)
931
933 '''
934 Initiates a drag that allows a window to be resized with the mouse.
935
936 Direction specifies how the window should be resized, and what the pointer
937 should look like. For example, if Direction is set to "BottomRight", then only
938 the width and height of the window can change---but not the x or y position.
939
940 Valid values for Direction are: Infer, Top, Bottom, Left, Right, TopLeft,
941 TopRight, BottomLeft and BottomRight. When "Infer" is used, the direction
942 is determined based on where the pointer is on the window when the drag is
943 initiated.
944
945 This is a special command that can only be assigned in Wingo's mouse
946 configuration file. Invoking this command in any other way has no effect.
947 '''
948 self._assert_arg_type('Direction', Direction, [basestring])
949
950 arg_str = self._gribble_arg_str([Direction])
951 val = self.gribble('MouseResize %s' % arg_str)
952 return self._from_str('MouseResize', val)
953
954 - def Move(self, Client, X, Y):
955 '''
956 Moves the window specified by Client to the x and y position specified by
957 X and Y. Note that the origin is located in the top left corner.
958
959 X and Y may either be pixels (integers) or ratios in the range 0.0 to
960 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
961 window's workspace's geometry.
962
963 Client may be the window id or a substring that matches a window name.
964 '''
965 self._assert_arg_type('Client', Client, [int, basestring])
966 self._assert_arg_type('X', X, [float, int])
967 self._assert_arg_type('Y', Y, [float, int])
968
969 arg_str = self._gribble_arg_str([Client, X, Y])
970 val = self.gribble('Move %s' % arg_str)
971 return self._from_str('Move', val)
972
974 '''
975 Moves the pointer to the x and y position specified by X and Y. Note the the
976 origin is located in the top left corner.
977 '''
978 self._assert_arg_type('X', X, [int])
979 self._assert_arg_type('Y', Y, [int])
980
981 arg_str = self._gribble_arg_str([X, Y])
982 val = self.gribble('MovePointer %s' % arg_str)
983 return self._from_str('MovePointer', val)
984
986 '''
987 Moves the pointer to the x and y position specified by X and Y relative to the
988 current workspace. Note the the origin is located in the top left corner of
989 the current workspace.
990
991 X and Y may either be pixels (integers) or ratios in the range 0.0 to
992 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
993 workspace's geometry.
994 '''
995 self._assert_arg_type('X', X, [float, int])
996 self._assert_arg_type('Y', Y, [float, int])
997
998 arg_str = self._gribble_arg_str([X, Y])
999 val = self.gribble('MovePointerRelative %s' % arg_str)
1000 return self._from_str('MovePointerRelative', val)
1001
1003 '''
1004 Moves the window specified by Client to the x and y position specified by
1005 X and Y, relative to its workspace. Note that the origin is located in the top
1006 left corner of the client's workspace.
1007
1008 X and Y may either be pixels (integers) or ratios in the range 0.0 to
1009 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
1010 window's workspace's geometry.
1011
1012 Client may be the window id or a substring that matches a window name.
1013 '''
1014 self._assert_arg_type('Client', Client, [int, basestring])
1015 self._assert_arg_type('X', X, [float, int])
1016 self._assert_arg_type('Y', Y, [float, int])
1017
1018 arg_str = self._gribble_arg_str([Client, X, Y])
1019 val = self.gribble('MoveRelative %s' % arg_str)
1020 return self._from_str('MoveRelative', val)
1021
1022 - def Not(self, Op):
1023 '''
1024 Returns the negation of Op. When Op is 0, Not returns 1. When Op is 1, Not
1025 returns 0.
1026
1027 If Op is not in {0, 1}, then a warning is logged and nil is returned.
1028 '''
1029 self._assert_arg_type('Op', Op, [int])
1030
1031 arg_str = self._gribble_arg_str([Op])
1032 val = self.gribble('Not %s' % arg_str)
1033 return self._from_str('Not', val)
1034
1035 - def Or(self, Op1, Op2):
1036 '''
1037 Returns the logical OR of Op1 and Op2.
1038
1039 If Op1 or Op2 is not in {0, 1}, then a warning is logged and nil is returned.
1040 '''
1041 self._assert_arg_type('Op1', Op1, [int])
1042 self._assert_arg_type('Op2', Op2, [int])
1043
1044 arg_str = self._gribble_arg_str([Op1, Op2])
1045 val = self.gribble('Or %s' % arg_str)
1046 return self._from_str('Or', val)
1047
1049 '''
1050 Stops Wingo.
1051 '''
1052
1053 arg_str = self._gribble_arg_str([])
1054 val = self.gribble('Quit %s' % arg_str)
1055 return self._from_str('Quit', val)
1056
1057 - def Raise(self, Client):
1058 '''
1059 Raises the window specified by Client to the top of its layer.
1060
1061 Client may be the window id or a substring that matches a window name.
1062 '''
1063 self._assert_arg_type('Client', Client, [int, basestring])
1064
1065 arg_str = self._gribble_arg_str([Client])
1066 val = self.gribble('Raise %s' % arg_str)
1067 return self._from_str('Raise', val)
1068
1070 '''
1071 Removes the workspace specified by Workspace. Note that a workspace can *only*
1072 be removed if it is empty (i.e., does not contain any windows).
1073
1074 Workspace may be a workspace index (integer) starting at 0, or a workspace
1075 name.
1076 '''
1077 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1078
1079 arg_str = self._gribble_arg_str([Workspace])
1080 val = self.gribble('RemoveWorkspace %s' % arg_str)
1081 return self._from_str('RemoveWorkspace', val)
1082
1084 '''
1085 Renames the workspace specified by Workspace to the name in NewName.
1086
1087 Workspace may be a workspace index (integer) starting at 0, or a workspace
1088 name.
1089 NewName can only be a string.
1090 '''
1091 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1092 self._assert_arg_type('NewName', NewName, [basestring])
1093
1094 arg_str = self._gribble_arg_str([Workspace, NewName])
1095 val = self.gribble('RenameWorkspace %s' % arg_str)
1096 return self._from_str('RenameWorkspace', val)
1097
1098 - def Resize(self, Client, Width, Height):
1099 '''
1100 Resizes the window specified by Client to some width and height specified by
1101 Width and Height.
1102
1103 Width and Height may either be pixels (integers) or ratios in the range 0.0 to
1104 1.0 (specifically, (0.0, 1.0]). Ratios are measured with respect to the
1105 window's workspace's geometry.
1106
1107 Client may be the window id or a substring that matches a window name.
1108 '''
1109 self._assert_arg_type('Client', Client, [int, basestring])
1110 self._assert_arg_type('Width', Width, [float, int])
1111 self._assert_arg_type('Height', Height, [float, int])
1112
1113 arg_str = self._gribble_arg_str([Client, Width, Height])
1114 val = self.gribble('Resize %s' % arg_str)
1115 return self._from_str('Resize', val)
1116
1118 '''
1119 Restarts Wingo in place using exec. This should be used to reload Wingo
1120 after you've made changes to its configuration.
1121 '''
1122
1123 arg_str = self._gribble_arg_str([])
1124 val = self.gribble('Restart %s' % arg_str)
1125 return self._from_str('Restart', val)
1126
1128 '''
1129 Executes a script in $XDG_CONFIG_HOME/wingo/scripts. The command
1130 may include arguments.
1131 '''
1132 self._assert_arg_type('Command', Command, [basestring])
1133
1134 arg_str = self._gribble_arg_str([Command])
1135 val = self.gribble('Script %s' % arg_str)
1136 return self._from_str('Script', val)
1137
1139 '''
1140 Returns the path to a script's configuration file.
1141 '''
1142 self._assert_arg_type('ScriptName', ScriptName, [basestring])
1143
1144 arg_str = self._gribble_arg_str([ScriptName])
1145 val = self.gribble('ScriptConfig %s' % arg_str)
1146 return self._from_str('ScriptConfig', val)
1147
1148 - def SelectClient(self, TabCompletion, OnlyActiveWorkspace, OnlyVisible, ShowIconified):
1149 '''
1150 Shows a centered prompt window with a list of clients satisfying the arguments
1151 provided.
1152
1153 OnlyActiveWorkspace specifies that only clients on the current workspace should
1154 be listed. Valid values are "yes" or "no".
1155
1156 OnlyVisible specifies that only clients on visible workspaces should be listed.
1157 Valid values are "yes" or "no".
1158
1159 ShowIconified specifies that iconified clients will be shown. Valid values are
1160 "yes" or "no".
1161
1162 TabCompletetion can be set to either "Prefix", "Any" or "Multiple". When it's
1163 set to "Prefix", the clients can be searched by a prefix matching string. When
1164 it's set to "Any", the clients can be searched by a substring matching string.
1165 When it's set to "Multiple", the clients can be searched by multiple space-
1166 separated substring matching strings.
1167
1168 This command may be used as a sub-command to pass a particular client to
1169 another command.
1170 '''
1171 self._assert_arg_type('TabCompletion', TabCompletion, [basestring])
1172 self._assert_arg_type('OnlyActiveWorkspace', OnlyActiveWorkspace, [basestring])
1173 self._assert_arg_type('OnlyVisible', OnlyVisible, [basestring])
1174 self._assert_arg_type('ShowIconified', ShowIconified, [basestring])
1175
1176 arg_str = self._gribble_arg_str([TabCompletion, OnlyActiveWorkspace, OnlyVisible, ShowIconified])
1177 val = self.gribble('SelectClient %s' % arg_str)
1178 return self._from_str('SelectClient', val)
1179
1181 '''
1182 Shows a centered prompt window with a list of all workspaces.
1183
1184 TabCompletetion can be set to either "Prefix", "Any" or "Multiple". When it's
1185 set to "Prefix", the clients can be searched by a prefix matching string. When
1186 it's set to "Any", the clients can be searched by a substring matching string.
1187 When it's set to "Multiple", the clients can be searched by multiple space-
1188 separated substring matching strings.
1189
1190 This command may be used as a sub-command to pass a particular workspace to
1191 another command.
1192 '''
1193 self._assert_arg_type('TabCompletion', TabCompletion, [basestring])
1194
1195 arg_str = self._gribble_arg_str([TabCompletion])
1196 val = self.gribble('SelectWorkspace %s' % arg_str)
1197 return self._from_str('SelectWorkspace', val)
1198
1200 '''
1201 Sets the current layout of the workspace specified by Workspace to the layout
1202 named by Name. If a layout with name Name does not exist, this command has
1203 no effect.
1204
1205 Note that this command has no effect if the workspace is not visible.
1206
1207 Workspace may be a workspace index (integer) starting at 0, or a workspace
1208 name.
1209 '''
1210 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1211 self._assert_arg_type('Name', Name, [basestring])
1212
1213 arg_str = self._gribble_arg_str([Workspace, Name])
1214 val = self.gribble('SetLayout %s' % arg_str)
1215 return self._from_str('SetLayout', val)
1216
1218 '''
1219 Sets the opacity of the window specified by Client to the opacity level
1220 specified by Opacity.
1221
1222 This command won't have any effect unless you're running a compositing manager
1223 like compton or cairo-compmgr.
1224
1225 Client may be the window id or a substring that matches a window name.
1226
1227 Opacity should be a float in the range 0.0 to 1.0, inclusive, where 0.0 is
1228 completely transparent and 1.0 is completely opaque.
1229 '''
1230 self._assert_arg_type('Client', Client, [int, basestring])
1231 self._assert_arg_type('Opacity', Opacity, [float])
1232
1233 arg_str = self._gribble_arg_str([Client, Opacity])
1234 val = self.gribble('SetOpacity %s' % arg_str)
1235 return self._from_str('SetOpacity', val)
1236
1237 - def Shell(self, Command):
1238 '''
1239 Attempts to execute the shell command specified by Command. If an error occurs,
1240 it will be logged to Wingo's stderr.
1241 '''
1242 self._assert_arg_type('Command', Command, [basestring])
1243
1244 arg_str = self._gribble_arg_str([Command])
1245 val = self.gribble('Shell %s' % arg_str)
1246 return self._from_str('Shell', val)
1247
1249 '''
1250 Sets the appropriate flags so that the window specified by Client is
1251 shown on panels and pagers.
1252
1253 Client may be the window id or a substring that matches a window name.
1254 '''
1255 self._assert_arg_type('Client', Client, [int, basestring])
1256
1257 arg_str = self._gribble_arg_str([Client])
1258 val = self.gribble('ShowClientInPanels %s' % arg_str)
1259 return self._from_str('ShowClientInPanels', val)
1260
1261 - def TagGet(self, Client, Name):
1262 '''
1263 Retrieves the tag with name Name for the client specified by Client.
1264
1265 Client may be the window id or a substring that matches a window name.
1266
1267 Tag names may only contain the following characters: [-a-zA-Z0-9_].
1268 '''
1269 self._assert_arg_type('Client', Client, [int, basestring])
1270 self._assert_arg_type('Name', Name, [basestring])
1271
1272 arg_str = self._gribble_arg_str([Client, Name])
1273 val = self.gribble('TagGet %s' % arg_str)
1274 return self._from_str('TagGet', val)
1275
1291
1293 '''
1294 Toggles whether the window specified by Client should be forced into the
1295 floating layout. A window forced into the floating layout CANNOT be tiled.
1296
1297 Client may be the window id or a substring that matches a window name.
1298 '''
1299 self._assert_arg_type('Client', Client, [int, basestring])
1300
1301 arg_str = self._gribble_arg_str([Client])
1302 val = self.gribble('ToggleFloating %s' % arg_str)
1303 return self._from_str('ToggleFloating', val)
1304
1306 '''
1307 Iconifies (minimizes) or deiconifies (unminimizes) the window specified by
1308 Client.
1309
1310 Client may be the window id or a substring that matches a window name.
1311 '''
1312 self._assert_arg_type('Client', Client, [int, basestring])
1313
1314 arg_str = self._gribble_arg_str([Client])
1315 val = self.gribble('ToggleIconify %s' % arg_str)
1316 return self._from_str('ToggleIconify', val)
1317
1319 '''
1320 Maximizes or restores the window specified by Client.
1321
1322 Client may be the window id or a substring that matches a window name.
1323 '''
1324 self._assert_arg_type('Client', Client, [int, basestring])
1325
1326 arg_str = self._gribble_arg_str([Client])
1327 val = self.gribble('ToggleMaximize %s' % arg_str)
1328 return self._from_str('ToggleMaximize', val)
1329
1331 '''
1332 Toggles the layer of the window specified by Client from normal to above. When
1333 a window is in the "above" layer, it will always be above other (normal)
1334 clients.
1335
1336 Client may be the window id or a substring that matches a window name.
1337 '''
1338 self._assert_arg_type('Client', Client, [int, basestring])
1339
1340 arg_str = self._gribble_arg_str([Client])
1341 val = self.gribble('ToggleStackAbove %s' % arg_str)
1342 return self._from_str('ToggleStackAbove', val)
1343
1345 '''
1346 Toggles the layer of the window specified by Client from normal to below. When
1347 a window is in the "below" layer, it will always be below other (normal)
1348 clients.
1349
1350 Client may be the window id or a substring that matches a window name.
1351 '''
1352 self._assert_arg_type('Client', Client, [int, basestring])
1353
1354 arg_str = self._gribble_arg_str([Client])
1355 val = self.gribble('ToggleStackBelow %s' % arg_str)
1356 return self._from_str('ToggleStackBelow', val)
1357
1359 '''
1360 Toggles the sticky status of the window specified by Client. When a window is
1361 sticky, it will always be visible unless iconified. (i.e., it does not belong
1362 to any particular workspace.)
1363
1364 Client may be the window id or a substring that matches a window name.
1365 '''
1366 self._assert_arg_type('Client', Client, [int, basestring])
1367
1368 arg_str = self._gribble_arg_str([Client])
1369 val = self.gribble('ToggleSticky %s' % arg_str)
1370 return self._from_str('ToggleSticky', val)
1371
1373 '''
1374 Always returns 1.
1375 '''
1376
1377 arg_str = self._gribble_arg_str([])
1378 val = self.gribble('True %s' % arg_str)
1379 return self._from_str('True', val)
1380
1382 '''
1383 Unfloats the window specified by Client. If the window is not floating,
1384 this command has no effect.
1385
1386 Client may be the window id or a substring that matches a window name.
1387 '''
1388 self._assert_arg_type('Client', Client, [int, basestring])
1389
1390 arg_str = self._gribble_arg_str([Client])
1391 val = self.gribble('Unfloat %s' % arg_str)
1392 return self._from_str('Unfloat', val)
1393
1395 '''
1396 Unmaximizes the window specified by Client. If the window is not maximized,
1397 this command has no effect.
1398
1399 Client may be the window id or a substring that matches a window name.
1400 '''
1401 self._assert_arg_type('Client', Client, [int, basestring])
1402
1403 arg_str = self._gribble_arg_str([Client])
1404 val = self.gribble('Unmaximize %s' % arg_str)
1405 return self._from_str('Unmaximize', val)
1406
1408 '''
1409 Executes a series of Wingo commands specified by Commands. If an error occurs
1410 while executing the command, it will be shown in a popup message.
1411 '''
1412 self._assert_arg_type('Commands', Commands, [basestring])
1413
1414 arg_str = self._gribble_arg_str([Commands])
1415 val = self.gribble('WingoExec %s' % arg_str)
1416 return self._from_str('WingoExec', val)
1417
1419 '''
1420 Shows the usage information for a particular command specified by CommandName.
1421 '''
1422 self._assert_arg_type('CommandName', CommandName, [basestring])
1423
1424 arg_str = self._gribble_arg_str([CommandName])
1425 val = self.gribble('WingoHelp %s' % arg_str)
1426 return self._from_str('WingoHelp', val)
1427
1429 '''
1430 Sets the current workspace to the one specified by Workspace.
1431
1432 Workspace may be a workspace index (integer) starting at 0, or a workspace
1433 name.
1434 '''
1435 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1436
1437 arg_str = self._gribble_arg_str([Workspace])
1438 val = self.gribble('Workspace %s' % arg_str)
1439 return self._from_str('Workspace', val)
1440
1442 '''
1443 Sets the current workspace to the one specified by Workspace in a greedy
1444 fashion.
1445
1446 A greedy switch *always* brings the specified workspace to the
1447 currently focused head. (N.B. Greedy is only different when switching between
1448 two visible workspaces.)
1449
1450 Workspace may be a workspace index (integer) starting at 0, or a workspace
1451 name.
1452 '''
1453 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1454
1455 arg_str = self._gribble_arg_str([Workspace])
1456 val = self.gribble('WorkspaceGreedy %s' % arg_str)
1457 return self._from_str('WorkspaceGreedy', val)
1458
1460 '''
1461 Sets the current workspace to the workspace specified by Workspace in a greedy
1462 fashion, and moves the window specified by Client to that workspace.
1463
1464 A greedy switch *always* brings the specified workspace to the
1465 currently focused head. (N.B. Greedy is only different when switching between
1466 two visible workspaces.)
1467
1468 Workspace may be a workspace index (integer) starting at 0, or a workspace
1469 name.
1470
1471 Client may be the window id or a substring that matches a window name.
1472 '''
1473 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1474 self._assert_arg_type('Client', Client, [int, basestring])
1475
1476 arg_str = self._gribble_arg_str([Workspace, Client])
1477 val = self.gribble('WorkspaceGreedyWithClient %s' % arg_str)
1478 return self._from_str('WorkspaceGreedyWithClient', val)
1479
1481 '''
1482 Retrieves the head index of the workspace specified by Workspace. If the
1483 workspace is not visible, then -1 is returned.
1484
1485 Head indexing starts at 0. Heads are ordered by their physical position: left
1486 to right and then top to bottom.
1487
1488 Workspace may be a workspace index (integer) starting at 0, or a workspace
1489 name.
1490 '''
1491 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1492
1493 arg_str = self._gribble_arg_str([Workspace])
1494 val = self.gribble('WorkspaceHead %s' % arg_str)
1495 return self._from_str('WorkspaceHead', val)
1496
1498 '''
1499 Sends the window specified by Client to the workspace specified by Workspace.
1500
1501 Workspace may be a workspace index (integer) starting at 0, or a workspace
1502 name.
1503
1504 Client may be the window id or a substring that matches a window name.
1505 '''
1506 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1507 self._assert_arg_type('Client', Client, [int, basestring])
1508
1509 arg_str = self._gribble_arg_str([Workspace, Client])
1510 val = self.gribble('WorkspaceSendClient %s' % arg_str)
1511 return self._from_str('WorkspaceSendClient', val)
1512
1514 '''
1515 Sets the workspace specified by Workspace to appear on the head specified by
1516 the Head index.
1517
1518 Workspace may be a workspace index (integer) starting at 0, or a workspace
1519 name.
1520
1521 Head indexing starts at 0. Heads are ordered by their physical position: left
1522 to right and then top to bottom.
1523 '''
1524 self._assert_arg_type('Head', Head, [int])
1525 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1526
1527 arg_str = self._gribble_arg_str([Head, Workspace])
1528 val = self.gribble('WorkspaceToHead %s' % arg_str)
1529 return self._from_str('WorkspaceToHead', val)
1530
1532 '''
1533 Sets the current workspace to the workspace specified by Workspace, and moves
1534 the window specified by Client to that workspace.
1535
1536 Workspace may be a workspace index (integer) starting at 0, or a workspace
1537 name.
1538
1539 Client may be the window id or a substring that matches a window name.
1540 '''
1541 self._assert_arg_type('Workspace', Workspace, [int, basestring])
1542 self._assert_arg_type('Client', Client, [int, basestring])
1543
1544 arg_str = self._gribble_arg_str([Workspace, Client])
1545 val = self.gribble('WorkspaceWithClient %s' % arg_str)
1546 return self._from_str('WorkspaceWithClient', val)
1547