-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·92 lines (83 loc) · 3.47 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
#!/bin/bash
PATTERN=$1
prompt-file() {
SRC=$1
DEST=$2
SUDO=$3
if [ "$SUDO" != "sudo" ]; then
SUDO=""
fi
if [[ -n "$PATTERN" ]] && [[ "${SRC#$PWD}" != *"$PATTERN"* ]] && [[ "${DEST#$PWD}" != *"$PATTERN"* ]]; then
echo "Skipping $SRC"
return
fi
while true; do
echo "Do you want to create a symlink from $SRC to $DEST? (y/n)"
if [ -e "$DEST" ]; then
echo "NOTE: $DEST exists already!"
fi
read -r ANSWER
ANSWER=${ANSWER,,}
echo "Answer: $ANSWER"
if [ "$ANSWER" == "y" ]; then
# back up current file if it already exists
if [ -e "$DEST" ]; then
echo "* Backing up $DEST..."
$SUDO mv "$DEST" "$DEST.bak"
fi
if [ "$SUDO" == "sudo" ]; then
echo -n "* (root) "
else
echo -n "* "
fi
echo "Creating symlink from $SRC to $DEST"
$SUDO mkdir -p "$(dirname $DEST)"
$SUDO ln -sn "$SRC" "$DEST"
echo ""
break
elif [ "$ANSWER" == "n" ]; then
echo "Skipping..."
break
else
echo "Invalid answer, should be (y/n)"
fi
done
}
echo "*** LINUX"
prompt-file "$PWD/vim" "$HOME/.vim"
prompt-file "$PWD/vim" "$HOME/.config/nvim"
prompt-file "$PWD/awesome" "$HOME/.config/awesome"
prompt-file "$PWD/arch/bashrc" "$HOME/.bashrc"
prompt-file "$PWD/arch/bash-sourcer.sh" "$HOME/.bash-sourcer.sh"
prompt-file "$PWD/arch/fzf.bash" "$HOME/.fzf.bash"
prompt-file "$PWD/arch/inputrc" "$HOME/.inputrc"
prompt-file "$PWD/arch/tmux.conf" "$HOME/.tmux.conf"
prompt-file "$PWD/arch/tmux-session.conf" "$HOME/.tmux-session.conf"
prompt-file "$PWD/arch/tridactylrc" "$HOME/.tridactylrc"
prompt-file "$PWD/arch/asoundrc" "$HOME/.asoundrc"
prompt-file "$PWD/arch/pulseaudio-ctl-config" "$HOME/.config/pulseaudio-ctl/config"
prompt-file "$PWD/arch/gitconfig" "$HOME/.gitconfig"
prompt-file "$PWD/arch/xinitrc" "$HOME/.xinitrc"
prompt-file "$PWD/arch/ctags" "$HOME/.ctags.d/default.ctags"
prompt-file "$PWD/arch/git-templates" "$HOME/.git-templates"
prompt-file "$PWD/arch/gitignore" "$HOME/.gitignore"
prompt-file "$PWD/arch/fonts" "$HOME/.fonts"
prompt-file "$PWD/arch/gruvbox-dark.theme" "$HOME/.local/share/xfce4/terminal/colorschemes/gruvbox-dark.theme"
prompt-file "$PWD/arch/autorandr" "$HOME/.config/autorandr"
prompt-file "$PWD/arch/pylintrc" "$HOME/.config/pylintrc"
prompt-file "$PWD/ipython/ipython_config.py" "$HOME/.ipython/profile_default/ipython_config.py"
prompt-file "$PWD/ipython/10-imports.py" "$HOME/.ipython/profile_default/startup/10-imports.py"
prompt-file "$PWD/ipython/20-defs.py" "$HOME/.ipython/profile_default/startup/20-defs.py"
prompt-file "$PWD/ulauncher/scripts.json" "$HOME/.config/ulauncher/scripts.json"
prompt-file "$PWD/ulauncher/theme" "$HOME/.config/ulauncher/user-themes/mysty"
echo -e "\n*** LINUX (root)"
prompt-file "$PWD/awesome/theme" "/usr/share/awesome/themes/mysty" sudo
prompt-file "$PWD/arch/slim.conf" "/etc/slim.conf" sudo
prompt-file "$PWD/arch/locale.conf" "/etc/locale.conf" sudo
prompt-file "$PWD/arch/locale.gen" "/etc/locale.gen" sudo
prompt-file "$PWD/arch/00-keyboard.conf" "/etc/X11/xorg.conf.d/00-keyboard.conf" sudo
prompt-file "$PWD/arch/10-monitor.conf" "/etc/X11/xorg.conf.d/10-monitor.conf" sudo
prompt-file "$PWD/arch/20-intel.conf" "/etc/X11/xorg.conf.d/20-intel.conf" sudo
prompt-file "$PWD/arch/30-amdgpu.conf" "/etc/X11/xorg.conf.d/30-amdgpu.conf" sudo
prompt-file "$PWD/arch/40-libinput.conf" "/etc/X11/xorg.conf.d/40-libinput.conf" sudo
prompt-file "$PWD/arch/50-synaptics.conf" "/etc/X11/xorg.conf.d/50-synaptics.conf" sudo