romkatv / powerlevel10k

A Zsh theme
MIT License
46.08k stars 2.17k forks source link

[question] How to trigger installing `gitstatusd` in Dockerfile #1831

Closed gabyx closed 2 years ago

gabyx commented 2 years ago

I am using powerlevel10k in a Dockerfile: I am setup .p10k.zsh in .zshrc and then run once:

zsh -c ". ~/.zshrc" </dev/null ||
    die "Could not source '.zshrc'."

to install all plugins ahead (such that they are already inplace in the image.)

How can I trigger that gitstatusd is installed as well?

romkatv commented 2 years ago
script -fqec zsh /dev/null </dev/null >/dev/null
gabyx commented 2 years ago

Ok, :) what does that do?

romkatv commented 2 years ago

Have you already checked man script?

It basically does the same thing as starting zsh interactively and exiting it.

gabyx commented 2 years ago

Ah, ok yes, just checked. But the question is then how to start a shell interactively inside dockerfile? Is that the workaround?

romkatv commented 2 years ago

But the question is then how to start a shell interactively inside dockerfile?

See above.

Is that the workaround?

Not sure what you mean.

gabyx commented 2 years ago

Ok, that starts gitstatusd, but is hangs, because the shell is not exiting. Do you know how to exit?

romkatv commented 2 years ago

Try this:

echo exit | script -qec zsh /dev/null >/dev/null
gabyx commented 2 years ago

Oh great. Something learned script. I actually did

script -fqec zsh /dev/null <(echo "exit 0") >/dev/null

which of course is pipeing a file...

gabyx commented 2 years ago

Thanks a lot, by the way powerlevel10k is best!

romkatv commented 2 years ago

Thanks a lot, by the way powerlevel10k is best!

You are welcome. And thanks ^^

gabyx commented 2 years ago

Since you seem to be a Linux master geek: maybe that thing is interesting for you: https://github.com/gabyx/Githooks