9
9
from subprocess import check_output
10
10
import i3ipc
11
11
12
+
12
13
def get_windows_on_ws (conn ):
13
14
return filter (lambda x : x .window , conn .get_tree ().find_focused ().workspace ().descendents ())
14
15
@@ -46,11 +47,11 @@ def main(args):
46
47
47
48
workspace = workspace_by_name (conn , args .workspace ) # Find workspace.
48
49
if workspace is None :
49
- print ("Workspace %s not found, making it." % args .workspace )
50
+ print ("Workspace %s not found, making it." % args .workspace )
50
51
conn .command ("workspace " + args .workspace )
51
52
52
53
else :
53
- windows = list (workspace .leaves ()) # Find windows in there.
54
+ windows = list (workspace .leaves ()) # Find windows in there.
54
55
if args .filter == 'visible' :
55
56
windows = filter (window_is_visible , windows )
56
57
elif args .filter != 'none' :
@@ -78,7 +79,7 @@ def main(args):
78
79
print ("Focussing %d" % window .window )
79
80
conn .command ('[id="%d"] focus' % window .window )
80
81
else :
81
- print ("Did not find window(%s) going to workspace anyway." % args .select )
82
+ print ("Did not find window(%s) going to workspace anyway." % args .select )
82
83
conn .command ("workspace " + args .workspace )
83
84
84
85
if args .mode != 'no' :
@@ -89,9 +90,8 @@ def main(args):
89
90
90
91
from argparse import ArgumentParser
91
92
92
- parser = ArgumentParser (
93
- prog = 'nth_window_in_workspace.py' ,
94
- description = """Program to:
93
+ parser = ArgumentParser (prog = 'nth_window_in_workspace.py' ,
94
+ description = """Program to:
95
95
* Select the nth window from a workspace. (i.e. for mapping each window to a key)
96
96
* Go to workspace, or cycle through the windows of the workspace.
97
97
(improvement on just going to the workspace)""" )
0 commit comments