global oh-my-zsh
This commit is contained in:
parent
b9ff7e5953
commit
35d8d4828b
4 changed files with 42 additions and 63 deletions
bundles/zsh
|
@ -21,7 +21,7 @@ function spwd {
|
|||
echo
|
||||
}
|
||||
|
||||
indicator="$(whoami)@$(hostname -s)"
|
||||
local indicator="$(whoami)@$(hostname -s)"
|
||||
local ret_status="%(?:%{$fg_bold[green]%}$indicator:%{$fg_bold[red]%}$indicator)"
|
||||
PROMPT='${ret_status} %{$fg[cyan]%}$(spwd)%{$reset_color%} $(git_prompt_info)'
|
||||
|
||||
|
|
|
@ -7,3 +7,10 @@
|
|||
# Global Order: zshenv, zprofile, zshrc, zlogin
|
||||
|
||||
alias s='sudo su - root -s /usr/bin/zsh'
|
||||
|
||||
ZSH_THEME=bw
|
||||
DISABLE_AUTO_UPDATE=true
|
||||
plugins=(
|
||||
zsh-autosuggestions
|
||||
)
|
||||
source /etc/zsh/oh-my-zsh/oh-my-zsh.sh
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
export ZSH=~/.zsh/oh-my-zsh
|
||||
ZSH_THEME=bw
|
||||
plugins=(
|
||||
zsh-autosuggestions
|
||||
)
|
||||
source $ZSH/oh-my-zsh.sh
|
|
@ -1,66 +1,44 @@
|
|||
from os.path import join
|
||||
|
||||
directories = {
|
||||
'/etc/zsh/oh-my-zsh': {},
|
||||
'/etc/zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions': {
|
||||
'mode': '644',
|
||||
'needs': [
|
||||
f"git_deploy:/etc/zsh/oh-my-zsh",
|
||||
]
|
||||
},
|
||||
'/etc/zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions': {
|
||||
'needs': [
|
||||
f"git_deploy:/etc/zsh/oh-my-zsh",
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
git_deploy = {
|
||||
'/etc/zsh/oh-my-zsh': {
|
||||
'repo': 'https://github.com/ohmyzsh/ohmyzsh.git',
|
||||
'rev': 'master',
|
||||
},
|
||||
'/etc/zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions': {
|
||||
'repo': 'https://github.com/zsh-users/zsh-autosuggestions.git',
|
||||
'rev': 'master',
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
'/etc/zsh/zprofile': {},
|
||||
'/etc/zsh/oh-my-zsh/themes/bw.zsh-theme': {
|
||||
'needs': [
|
||||
f"git_deploy:/etc/zsh/oh-my-zsh",
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
for name, user_config in node.metadata.get('users').items():
|
||||
if user_config.get('shell', None) != '/usr/bin/zsh':
|
||||
continue
|
||||
|
||||
directories.update({
|
||||
join(user_config['home'], '.zsh'): {
|
||||
files[join(user_config['home'], '.zshrc')] = {
|
||||
'owner': name,
|
||||
'group': name,
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh'): {
|
||||
'owner': name,
|
||||
'group': name,
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
|
||||
'owner': name,
|
||||
'group': name,
|
||||
'needs': [
|
||||
f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}",
|
||||
]
|
||||
},
|
||||
})
|
||||
|
||||
git_deploy.update({
|
||||
join(user_config['home'], '.zsh/oh-my-zsh'): {
|
||||
'repo': 'https://github.com/ohmyzsh/ohmyzsh.git',
|
||||
'rev': 'master',
|
||||
'triggers': [
|
||||
f'action:chown_zsh_{name}',
|
||||
],
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
|
||||
'repo': 'https://github.com/zsh-users/zsh-autosuggestions.git',
|
||||
'rev': 'master',
|
||||
'triggers': [
|
||||
f'action:chown_zsh_{name}',
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
files.update({
|
||||
join(user_config['home'], '.zshrc'): {
|
||||
'owner': name,
|
||||
'group': name,
|
||||
'source': 'zshrc',
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh/themes/bw.zsh-theme'): {
|
||||
'owner': name,
|
||||
'group': name,
|
||||
'needs': [
|
||||
f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}",
|
||||
]
|
||||
},
|
||||
})
|
||||
|
||||
actions.update({
|
||||
f'chown_zsh_{name}': {
|
||||
'command': f"chown -R {name}:{name} {user_config['home']}",
|
||||
'triggered': True,
|
||||
},
|
||||
})
|
||||
'content': '# bw managed',
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue