deluan / zsh-in-docker

Install Zsh, Oh-My-Zsh and plugins inside a Docker container with one line!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Powerlevel9k arguments overridden by default p10k theme

ddemarco96 opened this issue · comments

Thanks for this script! I'm a fan of p10k myself and have some custom styling I prefer. I tried adding those lines as -a args but was seeing something different in the final terminal. Here's the snippet from my Dockerfile:

RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.1/zsh-in-docker.sh)" -- \
    -t powerlevel10k/powerlevel10k \
    -a 'POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon virtualenv anaconda dir vcs newline)' \
    -a 'POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION="true"' \
    -a 'POWERLEVEL9K_ANACONDA_BACKGROUND="cyan"' \
    -a 'POWERLEVEL9K_DIR_BACKGROUND="mediumturquoise"' \
    -a 'POWERLEVE9K_MODE="nerdfont-complete"' \
    -a 'POWERLEVEL9K_PROMPT_ADD_NEWLINE="true"' \
    -a 'alias pip="pip3"' \
    -a 'alias ls="ls -GFh"' \
    -p git \
    -p git-extras \
    -p https://github.com/zsh-users/zsh-completions

I am pretty sure it's because of this bit appending to the zshrc and overriding the prompt elements line in mine:

# Install powerlevel10k if no other theme was specified
if [ "$THEME" = "powerlevel10k/powerlevel10k" ]; then
    git clone https://github.com/romkatv/powerlevel10k $HOME/.oh-my-zsh/custom/themes/powerlevel10k
    powerline10k_config >> $HOME/.zshrc
fi

This happens regardless of if you leave off the -t flag to use the default or specify powerlevel10k/powerlevel10k. Pretty sure the easiest fix might be to just use a different string for the default value of $THEME and check for that in the if condition instead! Thanks again!

Thanks for reporting this. Can you please provide a PR?

Agh update on this:
I missed the whole point being that PL10k isn't in the themes provided out of the box with oh-my-zsh. So if you currently specify pl10k with -t it can't find it. I'll circle back with another PR but it might be easiest to just move the order that the default 10k styles get added to the zshrc so that it's before any passed in with the command.

EDIT:
Scratch that. You just have to use the full link for the repo for PL10k and then you're good to go. Closing the issue!

Ops sorry, missed your previous messages. Yes, you'll need to include the full link for it to install P10K.