zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Feature: ability to create layout file from current layout

Open wheresvic opened this issue 3 years ago • 4 comments

Hello and thank you for making Zellij! Looks awesome and I'm looking to start using it daily.

One thing that would certainly make my life easier is if I could configure zellij layout and then export the layout file so I have the same layout on my work system.

Cheers!

wheresvic avatar Apr 26 '21 09:04 wheresvic

Thank you for the suggestion, this would be awesome!

a-kenji avatar Apr 26 '21 09:04 a-kenji

Hi, I'm a CS student looking to get some Rust experience, and I would like to take this on, if that is okay. I think I know of a way to solve the issue at hand.

AjiBuster499 avatar Jun 09 '22 19:06 AjiBuster499

After reading through the code, I have a question.

This functionality looks like it's already in place in the DumpScreen action, but it's not set in the default config anywhere. Why is this?

My basic idea was to take the current layout residing in memory and just dump it to a file/stdin, but while looking for the holder of said layout, I found DumpScreen, which does exactly this, but it's not anywhere in the default.yaml as a keybind.

AjiBuster499 avatar Jun 10 '22 12:06 AjiBuster499

The DumpScreen action doesn't interact with the layout, it is a misnomer. It doesn't dump the screen, it dumps the content of the currently specified pane (not the screen) inside of a specified file. It is not bound by default, because it depends heavily on the usecase, if it is useful for you.

a-kenji avatar Jun 10 '22 12:06 a-kenji

This would be awesome

vodrazka avatar Mar 12 '23 16:03 vodrazka

Just spent an hour trying to figure out how to lay out my current session with 3 tabs into a .kdl file :) This export would come very handy.

min2sia avatar May 09 '23 12:05 min2sia

Chiming in on this as well. This would be a great feature.

Lockszmith-GH avatar Sep 06 '23 16:09 Lockszmith-GH

Read https://zellij.dev/documentation/session-resurrection#session-files-in-the-cache and try find ~/.cache/zellij/ -iname '*.kdl'.

franalbani avatar Nov 15 '23 01:11 franalbani

Almost there. Instead of automated, having it on-demand would be awesome.

I would prefer to have the auto-generate/caching feature turned off, and be able to call zellij with a command line action to that would dump the current layout into the file of my choice.

Lockszmith-GH avatar Dec 03 '23 17:12 Lockszmith-GH

This is possible with zellij action dump-layout since 0.39, sorry - I still need to document it.

imsnif avatar Dec 03 '23 18:12 imsnif