zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Using neofetch into a panel layout

Open matiux opened this issue 10 months ago • 6 comments

I'm creating my first layout. I would have a panel with neofetch to see system information. This is my config

layout {
    pane cwd="/home/matiux" name="home"
    pane split_direction="vertical" {
        pane cwd="/" name="root" command="neofetch"
        pane name="htop" command="htop"
    }
}

I would like to have the prompt active after neofetch output, but instead I need to press ESC

Screenshot_20240420_231919

I would like to be in this status:

Screenshot_20240420_232410

matiux avatar Apr 20 '24 21:04 matiux

I think the command you want to run is not neofetch but your shell with neofetch as a startup command. For Fish that would be fish -C neofetch

MyApaulogies avatar Apr 21 '24 02:04 MyApaulogies

@MyApaulogies I have just tried like this

        pane split_direction="vertical" {
            pane cwd="/" name="root" command="/usr/bin/zsh" {
                args "-c" "neofetch"
            }
            pane name="htop" command="htop"
        }

But nothing seems to change. The behavior remains the same.

matiux avatar Apr 21 '24 11:04 matiux

It looks like zsh -c doesn't go into interactive mode afterwards, see https://superuser.com/q/91881

MyApaulogies avatar Apr 21 '24 23:04 MyApaulogies

@MyApaulogies There seems to be no clear solution. Or maybe I don't understand how

matiux avatar Apr 22 '24 08:04 matiux

I think the easiest solution there was to just

pane command="/usr/bin/zsh" {
   args "-c" "neofetch; exec zsh"
}

MyApaulogies avatar Apr 22 '24 20:04 MyApaulogies

I had tried with

if [[ $1 == eval ]]
then
    "$@"
set --
fi

but doesn't work very well as powerlevel10k warns me of unexpected output before running the prompt. Instead, args "-c" "neofetch; exec zsh" seems to works well.

matiux avatar Apr 22 '24 21:04 matiux