Compare commits

..

2 Commits

Author SHA1 Message Date
36bd56bcc4
Update tmux-pane-selection scripts to be more clear 2024-09-02 19:45:42 +02:00
78ce7dac48
Update 15.08.2024 2024-08-15 16:10:44 +02:00
3 changed files with 7 additions and 3 deletions

View File

@ -21,7 +21,7 @@ commands = defaultdict(list)
all_tty = [p.pane_tty for p in srv.panes] all_tty = [p.pane_tty for p in srv.panes]
cmd = f"-t {' -t '.join(all_tty)} -o pid:10 -o tty:10 -o command -ww -f" cmd = f"-t {' -t '.join(all_tty)} -o pid:10 -o tty:10 -o command -ww" # -f
sh_commands = sh.ps(cmd.split(' ')).stdout.decode().strip().split("\n") sh_commands = sh.ps(cmd.split(' ')).stdout.decode().strip().split("\n")
@ -55,7 +55,10 @@ def format_pane(pane):
else: else:
cmd = {"pid": "-", "command": "*command not found*"} cmd = {"pid": "-", "command": "*command not found*"}
return [f"{pane.pane_tty}: [Sess:{pane.session_name}, Win:{pane.window_name}] (cwd:{pane.pane_current_path.replace('/home/legrems/', '~/')}): {cmd['command']}"] path = pane.pane_current_path.replace("/home/legrems/Documents/Arcanite", "~/D/A")
path = path.replace("/home/legrems/Documents", "~/D")
path = path.replace("/home/legrems", "~")
return [f"{pane.pane_tty}: [{pane.session_name}: {pane.window_name}, {path}]: {cmd['command']}"]
panes = [] panes = []

View File

@ -12,6 +12,7 @@ folders = [
"~/Documents/PolyLAN/", "~/Documents/PolyLAN/",
"~/Documents/Python/", "~/Documents/Python/",
"~/Documents/", "~/Documents/",
"~/Documents/Games/Minecraft/modded/",
] ]
available_folders = sh.find(*[Path(f).expanduser() for f in folders] + "-mindepth 1 -maxdepth 1 -type d".split(" ")).strip().split("\n") available_folders = sh.find(*[Path(f).expanduser() for f in folders] + "-mindepth 1 -maxdepth 1 -type d".split(" ")).strip().split("\n")

View File

@ -106,7 +106,7 @@ for selected_group in selections:
if not servers: if not servers:
continue continue
window_name = get_window_name(info["section"]) window_name = get_window_name(selected_group)
if windows := active_session.windows.filter(name=window_name): if windows := active_session.windows.filter(name=window_name):
windows[0].select() windows[0].select()
continue continue