wip
This commit is contained in:
parent
9df817eca0
commit
59165f54c6
7 changed files with 114 additions and 1 deletions
31
bundles/oh-my-zsh/files/bw.zsh-theme
Normal file
31
bundles/oh-my-zsh/files/bw.zsh-theme
Normal file
|
@ -0,0 +1,31 @@
|
|||
function spwd {
|
||||
paths=(${(s:/:)PWD})
|
||||
|
||||
cur_path='/'
|
||||
cur_short_path='/'
|
||||
for directory in ${paths[@]}
|
||||
do
|
||||
cur_dir=''
|
||||
for (( i=0; i<${#directory}; i++ )); do
|
||||
cur_dir+="${directory:$i:1}"
|
||||
matching=("$cur_path"/"$cur_dir"*/)
|
||||
if [[ ${#matching[@]} -eq 1 ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
cur_short_path+="$cur_dir/"
|
||||
cur_path+="$directory/"
|
||||
done
|
||||
|
||||
printf %q "${cur_short_path: : -1}"
|
||||
echo
|
||||
}
|
||||
|
||||
indicator="$(hostname -s)"
|
||||
local ret_status="%(?:%{$fg_bold[green]%}$indicator:%{$fg_bold[red]%}$indicator)"
|
||||
PROMPT='${ret_status} %{$fg[cyan]%}$(spwd)%{$reset_color%} $(git_prompt_info)'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
|
6
bundles/oh-my-zsh/files/zshrc
Normal file
6
bundles/oh-my-zsh/files/zshrc
Normal file
|
@ -0,0 +1,6 @@
|
|||
export ZSH=~/.zsh/oh-my-zsh
|
||||
ZSH_THEME=bw
|
||||
plugins=(
|
||||
zsh-autosuggestions
|
||||
)
|
||||
source $ZSH/oh-my-zsh.sh
|
43
bundles/oh-my-zsh/items.py
Normal file
43
bundles/oh-my-zsh/items.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
from os.path import join
|
||||
|
||||
for name, user_config in node.metadata.get('users').items():
|
||||
if user_config.get('shell', None) != '/usr/bin/zsh':
|
||||
continue
|
||||
|
||||
directories = {
|
||||
join(user_config['home'], '.zsh'): {
|
||||
'owner': name,
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh'): {
|
||||
'owner': name,
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
|
||||
'owner': name,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
git_deploy = {
|
||||
join(user_config['home'], '.zsh/oh-my-zsh'): {
|
||||
'repo': 'git://github.com/ohmyzsh/ohmyzsh.git',
|
||||
'rev': 'master',
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): {
|
||||
'repo': 'git://github.com/zsh-users/zsh-autosuggestions.git',
|
||||
'rev': 'master',
|
||||
},
|
||||
}
|
||||
|
||||
files = {
|
||||
join(user_config['home'], '.zshrc'): {
|
||||
'owner': name,
|
||||
'source': 'zshrc',
|
||||
},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh/themes/bw.zsh-theme'): {
|
||||
'owner': name,
|
||||
'needs': [
|
||||
f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}",
|
||||
]
|
||||
},
|
||||
}
|
||||
|
14
bundles/zsh/items.py
Normal file
14
bundles/zsh/items.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from os.path import join
|
||||
|
||||
for name, user_config in node.metadata.get('users').items():
|
||||
print(user_config)
|
||||
if 'oh_my_zsh' in user_config:
|
||||
directories = {
|
||||
join(user_config['home'], '.zsh'): {},
|
||||
join(user_config['home'], '.zsh/oh-my-zsh'): {},
|
||||
}
|
||||
|
||||
git_deploy[join(user_config['home'], '.zsh/oh-my-zsh')] = {
|
||||
'repo': 'git://github.com/ohmyzsh/ohmyzsh.git',
|
||||
'rev': 'master',
|
||||
}
|
17
bundles/zsh/metadata.py
Normal file
17
bundles/zsh/metadata.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'zsh': {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'users'
|
||||
)
|
||||
def users(metadata):
|
||||
return {
|
||||
'users': {
|
||||
'user'
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
],
|
||||
'users': {
|
||||
'root': {
|
||||
'shell': '/usr/bin/zsh',
|
||||
'authorized_keys': [
|
||||
'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEU1l2ijW3ZqzFGZcdWg2ESgTGehdNfBTfafxsjWvWdS mwiegand@macbook',
|
||||
],
|
||||
|
|
|
@ -12,13 +12,14 @@
|
|||
],
|
||||
'bundles': [
|
||||
'nextcloud',
|
||||
'oh-my-zsh',
|
||||
'wireguard',
|
||||
'zfs',
|
||||
],
|
||||
'metadata': {
|
||||
'nextcloud': {
|
||||
'domain': 'cloud.sublimity.de',
|
||||
'version': '20.0.0',
|
||||
'version': '21.0.0',
|
||||
},
|
||||
'id': 'ea29bdf0-0b47-4bf4-8346-67d60c9dc4ae',
|
||||
'bind': {
|
||||
|
|
Loading…
Reference in a new issue