-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathz.sh
More file actions
executable file
·94 lines (73 loc) · 1.96 KB
/
z.sh
File metadata and controls
executable file
·94 lines (73 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
source ./src/common.sh
source ./src/zsh/welcome.sh
ghostty_configs() {
if command_exists ghostty; then
dots "Adding ghostty configs"
printf '%s\n' "theme = Homebrew" >> ~/.config/ghostty/config
printf '%s\n' "bell-features = no-title,no-attention" >> ~/.config/ghostty/config
printf '%s\n' "shell-integration-features = ssh-env" >> ~/.config/ghostty/config
return 0
else
print_warning "Ghostty isn't installed yet, skipping configs"
return 0
fi
}
set_colors() {
dots "Setting custom dircolors"
cat > ~/.dircolors <<'EOF'
# Directories (More contrast than blue)
DIR 01;36
# Symlinks and executables (optional)
LINK 01;35
EXEC 01;32
EOF
return 0
}
install_zsh() {
dots "Installing zsh shell"
sudo apt-get install -y zsh
return 0
}
setup_zsh_theme() {
dots "Setting zsh theme to powerlevel10k in .zshrc"
local theme="${1:-powerlevel10k/powerlevel10k}"
sed -i "s/^ZSH_THEME=\".*\"/ZSH_THEME=\"$theme\"/" ~/.zshrc
print_success "zsh theme changed to: $theme"
return 0
}
activate_zsh() {
dots "Restarting zsh shell"
source ~/.zshrc
return 0
}
install_oh_my_zsh() {
dots "Installing ohmyzsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
return 0
}
install_pl10k_theme() {
dots "Installing powerlevel10k theme"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
return 0
}
finish_setup() {
print_success "zsh setup complete!"
printf '%s\n' "Please restart your terminal to apply all changes"
printf '%s\n' "zsh installation by z.sh"
}
main() {
welcome
ghostty_configs
set_colors
update_system
install_zsh
setup_zsh_theme
activate_zsh
install_oh_my_zsh
install_pl10k_theme
finish_setup
return 0
}
# Run main
main