-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·106 lines (78 loc) · 2.18 KB
/
install.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
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
#!/bin/sh
# Write to console function
log()
{
echo "$1"
}
test_symbolic_link() {
# If file exists and is a symbolic link return true
if [ -d "$1" ] || [ -f "$1" ]; then
if [ ! -L "$1" ]; then
log "The $1 file exists and is not a symbolic link. Skipping"
fi
return 1
fi
return 0
}
create_directory() {
target_dir=$1
if [ ! -d "$target_dir" ]; then
log "Creating $target_dir directory"
mkdir -p "$target_dir"
log "directory created"
fi
}
create_link() {
target_loc=$1
local_loc=$2
if test_symbolic_link "$1"; then
log "Creating $1 link"
ln -s "$PWD/$local_loc" "$target_loc"
log "Symbolic link created"
fi
}
base_config_directory="$HOME/.config"
# Config directory, where config files without specific locations are stored
config_directory="$base_config_directory/dotfiles"
create_directory "$config_directory"
# Shell themes
theme_path="$config_directory/poshthemes"
create_link "$theme_path" "poshthemes"
# Shell config
shell_path="$base_config_directory/fish"
create_link "$shell_path" "fish"
# TODO: Run these as root
# sudo ln -s "$PWD/fish/bin_files" "/usr/local/bin/node"
# Nvim
nvim_path="$base_config_directory/nvim"
create_link "$nvim_path" "nvim"
# Lazy git
lazy_git_path="$base_config_directory/lazygit"
create_link "$lazy_git_path" "lazygit"
# Zathura
zathura_path="$base_config_directory/zathura"
create_link "$zathura_path" "zathura"
# Picom
picom_path="$base_config_directory/picom"
create_link "$picom_path" "picom"
# I3
i3_path="$base_config_directory/i3"
create_link "$i3_path" "i3"
# betterlockscreen
betterlockscreen_path="$base_config_directory/betterlockscreenrc"
create_link "$betterlockscreen_path" "betterlockscreen/betterlockscreenrc"
# Polybar
polybar_path="$base_config_directory/polybar"
create_link "$polybar_path" "polybar"
# Alacritty
alacritty_path="$base_config_directory/alacritty"
create_link "$alacritty_path" "alacritty"
# Rofi
rofi_path="$base_config_directory/rofi"
create_link "$rofi_path" "rofi"
# Dunst
dunst_path="$base_config_directory/dunst"
create_link "$dunst_path" "dunst"
# Kitty
kitty_path="$base_config_directory/kitty"
create_link "$kitty_path" "kitty"