Skip to content

Commit

Permalink
fix(zsh_plugins): fix p10k install on zsh plugins
Browse files Browse the repository at this point in the history
Previously, the lineinfile regexp used for install
p10k in zsh plugin was the same as the lineinfile
line arguments and it couldn't work.

This commit fix that by defining the variable to
use on lineinfile line param.
  • Loading branch information
diodonfrost committed Jan 18, 2021
1 parent 6b37ad9 commit 43b3824
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tasks/p10k-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
- name: Add powerlevel10k to zsh plugin
lineinfile:
path: "{{ p10k_zshrc_config[zsh_plugin]['zsh_file'] }}"
regexp: "^{{ p10k_zshrc_config[zsh_plugin]['source'] }}"
line: "{{ p10k_zshrc_config[zsh_plugin]['source'] }}"
regexp: "{{ p10k_zshrc_config[zsh_plugin]['regexp'] }}"
line: "{{ p10k_zshrc_config[zsh_plugin]['line'] }}"
owner: "{{ item }}"
group: "{{ item }}"
mode: '0644'
Expand Down
38 changes: 28 additions & 10 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,53 @@
p10k_path:
zsh: '~/powerlevel10k'
ohmyzsh: '~/.oh-my-zsh/custom/themes/powerlevel10k'
prezto: '~/powerlevel10k'
zim: '~/powerlevel10k'
antibody: '~/powerlevel10k'
antigen: '~/powerlevel10k'
zplug: '~/powerlevel10k'
zgen: '~/powerlevel10k'
zplugin: '~/powerlevel10k'
zinit: '~/powerlevel10k'

p10k_zshrc_config:
zsh:
source: 'source ~/powerlevel10k/powerlevel10k.zsh-theme'
regexp: '^source '
line: 'source ~/powerlevel10k/powerlevel10k.zsh-theme'
zsh_file: ~/.zshrc
ohmyzsh:
source: 'ZSH_THEME="powerlevel10k/powerlevel10k"'
regexp: '^ZSH_THEME='
line: 'ZSH_THEME="powerlevel10k/powerlevel10k"'
zsh_file: ~/.zshrc
prezto:
source: 'zstyle :prezto:module:prompt theme powerlevel10k'
regexp: '^zstyle :prezto:module:prompt theme'
line: 'zstyle :prezto:module:prompt theme powerlevel10k'
zsh_file: ~/.zpreztorc
zim:
source: 'zmodule romkatv/powerlevel10k'
regexp: '^zmodule '
line: 'zmodule romkatv/powerlevel10k'
zsh_file: ~/.zimrc
antibody:
source: 'antibody bundle romkatv/powerlevel10k'
regexp: '^antibody bundle '
line: 'antibody bundle romkatv/powerlevel10k'
zsh_file: ~/.zshrc
antigen:
source: 'antigen theme romkatv/powerlevel10k'
regexp: '^antigen theme '
line: 'antigen theme romkatv/powerlevel10k'
zsh_file: ~/.zshrc
zplug:
source: 'zplug romkatv/powerlevel10k, as:theme, depth:1'
regexp: '^zplug '
line: 'zplug romkatv/powerlevel10k, as:theme, depth:1'
zsh_file: ~/.zshrc
zgen:
source: 'zgen load romkatv/powerlevel10k powerlevel10k'
regexp: '^zgen load '
line: 'zgen load romkatv/powerlevel10k powerlevel10k'
zsh_file: ~/.zshrc
zplugin:
source: 'zplugin ice depth=1; zplugin light romkatv/powerlevel10k'
regexp: '^zplugin ice depth=1; zplugin light'
line: 'zplugin ice depth=1; zplugin light romkatv/powerlevel10k'
zsh_file: ~/.zshrc
zinit:
source: 'zinit ice depth=1; zinit light romkatv/powerlevel10k'
regexp: '^zinit ice depth=1; zinit light'
line: 'zinit ice depth=1; zinit light romkatv/powerlevel10k'
zsh_file: ~/.zshrc

0 comments on commit 43b3824

Please sign in to comment.