-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·157 lines (130 loc) · 4.23 KB
/
Copy pathinstall
File metadata and controls
executable file
·157 lines (130 loc) · 4.23 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/bin/bash
if [ ${EUID:-${UID}} = 0 ]; then
read -p "You are now a ROOT USER. OK to install? (y/N): " yn
case "$yn" in [yY]*) ;; *) echo "abort." ; exit ;; esac
fi
if ! command -v git &> /dev/null
then
echo 'Please install git'
exit 1
fi
CYAN='\033[0;34m'
NC='\033[0m'
gui=false
node=false
zinit=false
vimplug=false
pyenv=false
for i in "$@" ; do
case "$i" in
'gui' ) gui=true ;;
'node' ) node=true ;;
'zinit' ) zinit=true ;;
'vimplug' ) vimplug=true ;;
'pyenv' ) pyenv=true ;;
esac
done
mkdir -p ~/.cache/vim
mkdir -p ~/.config/systemd/user
mkdir -p ~/.local/share/systemd/user
mkdir -p ~/.zsh
mkdir -p ~/src
touch ~/.gitconfig_local
touch ~/.zshrc.pre
ln -fs ~/dotfiles/gitconfig ~/.gitconfig
ln -fs ~/dotfiles/gitignore_global ~/.gitignore_global
ln -fs ~/dotfiles/zshrc ~/.zshrc
ln -fs ~/dotfiles/tmux.conf ~/.tmux.conf
ln -fs ~/dotfiles/vimrc ~/.vimrc
ln -fs ~/dotfiles/editorconfig ~/.editorconfig
ln -fs ~/dotfiles/tigrc ~/.tigrc
ln -fs ~/dotfiles/pylintrc ~/.pylintrc
ln -fs ~/dotfiles/systemd/* ~/.local/share/systemd/user
ln -fs ~/dotfiles/latexmkrc ~/.latexmkrc
ln -fsn ~/dotfiles/zsh_completions ~/.zsh/completion
ln -fsn ~/dotfiles/vim ~/.vim
ln -fsn ~/dotfiles/nvim ~/.config/nvim
mkdir -p ~/.claude
ln -fs ~/dotfiles/claude/statusline.sh ~/.claude/statusline.sh
# Merge shared keys (statusLine, etc.) from dotfiles into ~/.claude/settings.json,
# preserving machine-local keys (enabledPlugins, permissions, ...).
if command -v jq &>/dev/null; then
claude_settings=~/.claude/settings.json
claude_fragment=~/dotfiles/claude/settings.json
tmp=$(mktemp)
if [ -f "$claude_settings" ]; then
jq -s '.[0] * .[1]' "$claude_settings" "$claude_fragment" > "$tmp" && mv "$tmp" "$claude_settings"
else
cp "$claude_fragment" "$claude_settings"
fi
rm -f "$tmp"
else
echo "jq not found; skipping ~/.claude/settings.json merge"
fi
# mkdir -p ~/.go
# mkdir -p ~/.config/zellij
# ln -fs ~/dotfiles/zshenv ~/.zshenv
# ln -fs ~/dotfiles/bashrc ~/.bashrc
# ln -fs ~/dotfiles/condarc ~/.condarc
# mkdir -p ~/.jupyter
# ln -fs ~/dotfiles/misc/jupyter_lab_config.py ~/.jupyter/
# mkdir -p ~/.ipython/profile_default/startup
# ln -fs ~/dotfiles/ipython/startup/* ~/.ipython/profile_default/startup
# ln -fs ~/dotfiles/zellij.kdl ~/.config/zellij/config.kdl
# GUI
if $gui; then
mkdir -p ~/.config/fontconfig/conf.d
ln -fs ~/dotfiles/fonts.conf ~/.config/fontconfig/conf.d/99-custom.conf
mkdir -p ~/.local/share/fonts
ln -fsn ~/dotfiles/fonts ~/.local/share/fonts/dotfiles
mkdir -p ~/.config/tym
ln -fs ~/dotfiles/tym/config.lua ~/.config/tym/config.lua
ln -fs ~/dotfiles/tym/local.lua ~/.config/tym/local.lua
# mkdir -p ~/.wineprefixes
# mkdir -p ~/.config/kitty
# ln -fs ~/dotfiles/kitty.conf ~/.config/kitty/kitty.conf
# mkdir -p ~/.mpv
# ln -fs ~/dotfiles/mpv.conf ~/.mpv/input.conf
mkdir -p ~/.config/environment.d
ln -fs ~/dotfiles/env.conf ~/.config/environment.d/dotfiles.conf
if [ -d ~/Sync ]; then
ln -fs ~/dotfiles/syncthing/stignore ~/Sync/.stignore
fi
if [ -d ~/Obsidian ]; then
ln -fs ~/dotfiles/syncthing/stignore ~/Obsidian/.stignore
fi
if [ -d ~/Documents ]; then
ln -fs ~/dotfiles/syncthing/stignore ~/Documents/.stignore
fi
if [ -d ~/Inbox ]; then
ln -fs ~/dotfiles/syncthing/stignore ~/Inbox/.stignore
fi
fi
if $node; then
if [ ! -d ~/.nodebrew ]; then
echo
echo -e "${CYAN}Installing nodebrew${NC}"
curl -L git.io/nodebrew | perl - setup
# node_version=16
# echo -e "${CYAN}Installing node.js ${node_version}${NC}"
# ~/.nodebrew/nodebrew install-binary ${node_version}
else
echo -e "${CYAN}Updating nodebrew${NC}"
~/.nodebrew/nodebrew selfupdate
fi
fi
if $zinit; then
echo -e "${CYAN}Installing zinit${NC}"
mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git"
fi
if $pyenv; then
echo -e "${CYAN}Installing pyenv${NC}"
if [ ! -d ~/.pyenv ]; then
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
else
echo -e "${CYAN}pyenv is already installed.${NC}"
fi
fi
echo -e "${CYAN}Done.${NC}"