-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsway-install-profile.zsh
executable file
·140 lines (111 loc) · 3.14 KB
/
sway-install-profile.zsh
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/env zsh
# This script runs by the login user to keep all the permissions
###
# Configs
###
node_version="lts/hydrogen"
fail() {
echo "Error: $1"
echo "Please re-run the script, exiting..."
exit 1
}
should_fail() {
if [ "$?" -ne 0 ]; then
fail "$1"
fi
}
# Make sure this path exist to avoid conflicts and making parent dir linked
mkdir -p $HOME/.local/bin $HOME/.local/share/fonts
stow_dirs=(
alacritty
albert
atuin
bin
common
containers
easyeffects
# flameshot
gnupg
lazygit
lazyvim # Choose between nvchad or lazyvim
mako
# nvchad
oh-my-posh
onedrive
# p10k
redshift
swappy
sway
swaylock
systemd
# thunar
tmux
wallpapers
waybar
wofi
zsh
)
#echo "=========================================="
#echo "Installing antidote"
#echo "=========================================="
# install it from github for non-arch distros
# git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote
echo "=========================================="
echo "🔗 Stowing dot files"
echo "=========================================="
for dir in ${stow_dirs[@]}; do
echo "Stowing $dir"
# LC_ALL=C fixes perl locale warning
# gracefully run stow and adopt
LC_ALL=C stow $dir --adopt
done
echo "=========================================="
echo "Caching fonts - Run 'fc-cache -rv' any time there is a file change at .local/share/fonts"
echo "=========================================="
fc-cache -rv
# add zsh to valid login shell
command -v zsh | sudo tee -a /etc/shells
should_fail "Adding zsh to valid login shells"
# Use zsh as default shell
sudo usermod --shell $(which zsh) $USER
should_fail "Changing user shell"
source "common/.zshenv"
source "$HOME/.zshenv"
# Load ZSH profile
source "$ZDOTDIR/.zshrc"
should_fail "Sourcing .zshrc shell environment"
# finally, link zsh config
stow zsh
# Loads plugins and nvm
source "$ZDOTDIR/.zshrc"
should_fail "sourcing pre-configured zsh shell environment"
# Change go mod path
go env -w GOMODCACHE="$XDG_CACHE_HOME/go/pkg/mod"
# Update nvm to latest
nvm upgrade
echo "=========================================="
echo "Installing node"
echo "=========================================="
nvm install $node_version
nvm alias default $node_version
nvm use default
npm install npm@latest yarn@latest pnpm@latest --location=global
echo "=========================================="
echo "Installing k9s catppuccin theme"
echo "=========================================="
OUT="${XDG_CONFIG_HOME:-$HOME/.config}/k9s/skins"
curl -L https://github.com/catppuccin/k9s/archive/main.tar.gz | tar xz -C "$OUT" --strip-components=2 k9s-main/dist
echo "=========================================="
echo "Installing python 3.11.7"
echo "=========================================="
pyenv install 3.11.7
pyenv global 3.11.7
echo "=========================================="
echo "🔃 System Service"
echo "=========================================="
systemctl --user enable gnmoe-keyring-gnome
systemctl --user enable ydotool
systemctl --user enable pipewire
systemctl --user enable wireplumber
systemctl --user enable redshift
systemctl --user enable --now ssh-agent.service