-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink.sh
executable file
·50 lines (42 loc) · 1.14 KB
/
link.sh
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
#!/bin/bash
function clean_and_symlink() {
SOURCE=$1
TARGET=$2
if test -e "$TARGET"; then
echo File $TARGET already exists.
rm -r $TARGET && echo Removed $TARGET succesfully.
fi
ln -sf $SOURCE $TARGET && echo Created symlink from $SOURCE to $TARGET.
}
function fish_config() {
echo ""
echo Configuring fish...
# Create symlink for fish config.
clean_and_symlink $(pwd)/fish ~/.config/fish
}
function alacritty_config() {
echo ""
echo Configuring alacritty...
# Create symlink for foot config.
clean_and_symlink $(pwd)/alacritty ~/.config/alacritty
# Symlink the local xterm binary to foot so gnome can open terminal
# applications using foot.
mkdir -p ~/.local/bin
clean_and_symlink /usr/bin/alacritty ~/.local/bin/xterm
}
function nvim_config() {
echo ""
echo Configuring nvim...
# Create symlink for neovim.
clean_and_symlink $(pwd)/nvim ~/.config/nvim
}
function helix_config() {
echo ""
echo Configuring helix...
# Create symlink for neovim.
clean_and_symlink $(pwd)/helix ~/.config/helix
}
helix_config
fish_config
nvim_config
alacritty_config