-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit
executable file
·44 lines (33 loc) · 1.18 KB
/
init
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
#!/usr/bin/env bash
# Init script to set up the symlinks for the config files
# Usage: ./init
CURRENTDIR="$(pwd)"
HOMEDIR=/Users/oliviac
echo "Changing to the ${CURRENTDIR} directory"
cd "${CURRENTDIR}" || exit
# create symlinks for all files in symlinks directory
create_symlinks() {
for file in "${CURRENTDIR}/symlinks"/*; do
local filename
filename="$(basename "${file}")"
echo "Creating a symlink to $filename in home directory"
[[ -r ${file} ]] && [[ -e ${file} ]] && rm -f "${HOMEDIR}/.${filename}" && ln -s "${file}" "${HOMEDIR}/.${filename}"
done
# spaceship prompt config
ln -sf "${CURRENTDIR}/config/starship.toml" "${HOMEDIR}/.config/starship.toml"
ln -sf "${CURRENTDIR}/config/kitty.conf" "${HOMEDIR}/.config/kitty/kitty.conf"
}
# create symlink for neovim config
# sync_vim() {
# for file in $(find nvim -name "*.vim" -o -name "*.json"); do
# mkdir -p ~/.config/nvim/plugin
# mkdir -p ~/.config/nvim/after/plugin
# mkdir -p ~/.config/nvim/lua
# echo "Creating a symlink to $file in home directory"
# ln -sf "${CURRENTDIR}/${file}" "${HOMEDIR}/.config/${file}"
# done
# }
create_symlinks
# sync_vim
unset create_symlinks
unset sync_vim