Closed roland-5 closed 1 year ago
Hey, I hope @dj95 does not mind if I interject here, as this is a tricky one if you don't know what's going on.
I think you need to make sure to include the default swap layouts if you're using a custom layout (as you are if you want to use this plugin). This should also help with #9
Thanks for your reply @imsnif ! I've tried to reproduce it on my MacBook yesterday without success. Issue #9 as well.
I'd try it tomorrow on my linux machine. But I think it will be tough to reproduce.
Damn, I forgot to write I use Arch Linux and Zellij 0.38.2
I did zellij setup --dump-swap-layout default > ~/.config/zellij/layouts/my-quickstart-swap-layout-file.swap.kdl
but now feel lost. In zjstatus.kdl
I should change this
layout {
pane split_direction="vertical" {
pane
}
but not sure what is best approach next. Delete everything in {} and paste everything from my-quickstart-swap-layout-file.swap.kdl
or I can source file, but not see any mention about in in wiki.
I added a {swap_layout}
widget with the latest commit to make the behavior more visible. You can use it to verify which layout is currently active and if it changes.
As @imsnif stated out, you need to add the swap layouts (from zellij setup --dump-swap-layout default
) either to your layout or in a file (.swap.kdl
) next to your layout. I've tested it with the swap layouts in one layout file. Here's a quick schematic, how it looks like.
layout {
// current tab, that is opened on starting zellij
ui {
pane
}
swap_tiled_layout name="vertical" {
// ... the one from the dump-swap-layout command
}
swap_tiled_layout name="horizontal" {
// ... the one from the dump-swap-layout command
}
tab_template name="ui" {
children
pane size=1 borderless=true {
plugin location="file:./zjstatus.wasm" {
format_left "{mode}{tabs}"
format_right "{session} {swap_layout}"
// further zjstatus config
}
}
}
}
This will not just fix this issue (since the default behavior is restored), but also will fix issue #9 due to the configuration of missing alternative swap layouts.
YES IT'S WORKING! For both of my mentioned problems. Thank you both, that was awesome! <3
For next generation people searching for whatever reason thins topic, my zjstatus.kdl
layout {
// current tab, that is opened on starting zellij
ui {
pane
}
swap_tiled_layout name="vertical" {
ui max_panes=5 {
pane split_direction="vertical" {
pane
pane { children; }
}
}
ui max_panes=8 {
pane split_direction="vertical" {
pane { children; }
pane { pane; pane; pane; pane; }
}
}
ui max_panes=12 {
pane split_direction="vertical" {
pane { children; }
pane { pane; pane; pane; pane; }
pane { pane; pane; pane; pane; }
}
}
}
swap_tiled_layout name="horizontal" {
// ... the one from the dump-swap-layout command
ui max_panes=5 {
pane
pane
}
ui max_panes=8 {
pane {
pane split_direction="vertical" { children; }
pane split_direction="vertical" { pane; pane; pane; pane; }
}
}
ui max_panes=12 {
pane {
pane split_direction="vertical" { children; }
pane split_direction="vertical" { pane; pane; pane; pane; }
pane split_direction="vertical" { pane; pane; pane; pane; }
}
}
}
tab_template name="ui" {
children
pane size=1 borderless=true {
plugin location="file:~/.config/zellij/plugins/zjstatus.wasm" {
format_left "{mode}{tabs}"
format_right "#[fg=#b8bb26,bold]{session} {swap_layout}"
first_start "false"
mode_normal "#[fg=#b8bb26,bold]{name}"
mode_locked "#[fg=#fb4934,bold]{name}"
mode_resize "#[fg=#fabd2f,bold]{name}"
mode_pane "#[fg=#d3869b,bold]{name}"
mode_tab "#[fg=#83a598,bold]{name}"
mode_scroll "#[fg=#8ec07c,bold]{name}"
mode_session "#[fg=#fe8019,bold]{name}"
mode_move "#[fg=#a89984,bold]{name}"
tab_normal "#[fg=#a89984,bold] {name}"
tab_active "#[fg=#83a598,bold] {name}"
}
}
}
}
I've added your config with a screenshot to the examples. So it's easier to find :)
https://github.com/dj95/zjstatus/blob/main/examples/swap-layouts.kdl
If you start zellij with
zellij
orzellij --layout compact
and make new pane withctrl+p n
, new pane will show on right side. But if I use zjstatus`zellij --layout zjstatus
then for 60-65% times it show under original pane. But then randomly sometimes if I start terminal and zellij with zjstatus second pane will show up on right side.https://asciinema.org/a/7JxHT2AJKewmXEpDeZyJkXIXJ
my
~/.config/zellij/layouts/zjstatus.kdl
my
~/.config/zellij/config.kdl
Have I set something wrong?