Workspaces named for what they are, capitalised; Reply gains a task panel; Project settings and limits; icon test row
This commit is contained in:
23
bin/board
23
bin/board
@@ -40,14 +40,17 @@ def pages(cfg, folder):
|
||||
bin_path = BIN
|
||||
proj = cfg["paperclip"]["project"]
|
||||
task = pj.watch_task(cfg)
|
||||
# (pane name, workspace name, command). The workspace is what a person reads
|
||||
# on the rail, so it is capitalised and says what the page is for; the pane
|
||||
# keeps the program's own name. Written Workspace>pane when talking about it.
|
||||
return task, [
|
||||
("shell", "shell", "exec zsh -i"),
|
||||
("board", "board", "%s -screen board -project %s -folder %s" % (shlex.quote(bin_path), proj, shlex.quote(folder))),
|
||||
("work", "work", "%s -screen work -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
("reply", "reply", "%s -screen reply -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
("new", "new", "%s -screen new -project %s" % (shlex.quote(bin_path), proj)),
|
||||
("project", "project", "%s -screen project -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
("repair", "repair", "%s -screen repair -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
("shell", "Shell", "exec zsh -i"),
|
||||
("board", "Board", "%s -screen board -project %s -folder %s" % (shlex.quote(bin_path), proj, shlex.quote(folder))),
|
||||
("work", "Work", "%s -screen work -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
("reply", "Reply", "%s -screen reply -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
("new", "New task", "%s -screen new -project %s" % (shlex.quote(bin_path), proj)),
|
||||
("project", "Project", "%s -screen project -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
("repair", "Repair", "%s -screen repair -folder %s" % (shlex.quote(bin_path), shlex.quote(folder))),
|
||||
]
|
||||
|
||||
|
||||
@@ -77,10 +80,10 @@ def main():
|
||||
name, workspace, folder, command, session,
|
||||
adopt_existing=(name == "shell"),
|
||||
)
|
||||
h.say(" %-6s %-8s workspace %s" % (name, result, ws))
|
||||
h.say(" %-9s %-8s workspace %s" % (name, result, ws))
|
||||
|
||||
for number, name in tuios.arrange([p[0] for p in page_list], session):
|
||||
h.say(" placed %-6s workspace %s" % (name, number))
|
||||
for number, name in tuios.arrange([(p[0], p[1]) for p in page_list], session):
|
||||
h.say(" placed %-8s workspace %s" % (name, number))
|
||||
|
||||
in_use = [w for w in tuios.workspaces(session) if (w.get("window_count") or 0) > 0]
|
||||
h.say("workspaces in use: %d" % len(in_use))
|
||||
|
||||
BIN
bin/harness
BIN
bin/harness
Binary file not shown.
Binary file not shown.
@@ -133,15 +133,18 @@ def open_pane(name, workspace_name, cwd, command, session=None, adopt_existing=F
|
||||
|
||||
|
||||
def arrange(order, session=None):
|
||||
"""Put these panes on workspaces 1..N in this order, and name them.
|
||||
"""Put these panes on workspaces 1..N in this order, and name the workspaces.
|
||||
|
||||
`order` is a list of (pane name, workspace name) pairs. The pane keeps its
|
||||
own name; the workspace gets the name a person reads on the rail.
|
||||
|
||||
TUIOS numbering follows the order panes land in, and closing panes renumbers
|
||||
the rest, so a rebuild can scatter the pages. Moving each pane once, at the
|
||||
end, is what makes the rail readable and stable.
|
||||
"""
|
||||
moved = []
|
||||
for number, name in enumerate(order, start=1):
|
||||
win = next((w for w in windows(session) if (w.get("custom_name") or "") == name), None)
|
||||
for number, (pane, workspace) in enumerate(order, start=1):
|
||||
win = next((w for w in windows(session) if (w.get("custom_name") or "") == pane), None)
|
||||
if win is None:
|
||||
continue
|
||||
if win.get("workspace") != number:
|
||||
@@ -149,8 +152,8 @@ def arrange(order, session=None):
|
||||
["tuios", "move-window", str(number), "-w", win["window_id"], "-s", session or SESSION],
|
||||
capture_output=True, text=True, timeout=30, check=False,
|
||||
)
|
||||
_name_workspace(number, name, session)
|
||||
moved.append((number, name))
|
||||
_name_workspace(number, workspace, session)
|
||||
moved.append((number, workspace))
|
||||
return moved
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user