diff options
Diffstat (limited to '')
-rwxr-xr-x | .i3/scripts/workspaces.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.i3/scripts/workspaces.py b/.i3/scripts/workspaces.py index 44de01f..498587b 100755 --- a/.i3/scripts/workspaces.py +++ b/.i3/scripts/workspaces.py @@ -46,6 +46,15 @@ def to_ws(cmd, prompt): if sel is not None: cmd(sel) +def rename(keep = False): + cur_ws = i3.filter(i3.get_workspaces(), focused = True)[0] + input = partial(sh.i3_input, P = "Rename workspace: ") + + if keep and cur_ws["num"]: + input(F = ('rename workspace to "%d: %%s"' % cur_ws["num"])) + else: + input(F = 'rename workspace to "%s"') + if __name__ == "__main__": try: arg = sys.argv[1] @@ -60,6 +69,10 @@ if __name__ == "__main__": new_ws(switch) elif arg == "move_new": new_ws(move) + elif arg == "rename": + rename(False) + elif arg == "rename_num": + rename(True) else: print("Unknown arg: %s" % arg) sys.exit(1) |