-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·68 lines (61 loc) · 2.48 KB
/
install
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
#!/usr/bin/env bash
# function for linking files
# not entirely happy with how this handles linking directories,
link_file () {
echo "============================================================"
echo "$2 -> $1"
target_dir="$( dirname "$2" )"
if [[ ! -d $target_dir ]]; then
read -p "Directory $target_dir does not exist. Create it now? (Y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo "Skipping $2..."
return
else
echo "Creating directory $target_dir"
mkdir -p "$target_dir"
fi
fi
if [[ -e $2 ]]; then
read -p "File $2 already exists. Overwrite it? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Linked dotfile $2 at $1"
ln -s -f "$1" "$2"
else
echo "Skipping $2..."
return
fi
else
echo "Linked dotfile $2 at $1"
ln -s "$1" "$2"
fi
}
# get the path to this directory
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "============================================================"
echo "INSTALLING DOTFILES FROM $BASEDIR"
# link all the files
# stuff for the home directory iself goes first
link_file "$BASEDIR/Xresources" ~/.Xresources
link_file "$BASEDIR/bash_profile" ~/.bash_profile
link_file "$BASEDIR/bashrc" ~/.bashrc
link_file "$BASEDIR/vimrc" ~/.vimrc
link_file "$BASEDIR/bash_aliases" ~/.bash_aliases
link_file "$BASEDIR/inputrc" ~/.inputrc
link_file "$BASEDIR/gtkrc-2.0" ~/.gtkrc-2.0
link_file "$BASEDIR/xprofile" ~/.xprofile
link_file "$BASEDIR/Xkeymap" ~/.Xkeymap
# then all the stuff tucked away in .config
link_file "$BASEDIR/gtk-3.0/settings.ini" ~/.config/gtk-3.0/settings.ini
link_file "$BASEDIR/gtk-3.0/gtk.css" ~/.config/gtk-3.0/gtk.css
link_file "$BASEDIR/fonts.conf" ~/.config/fontconfig/fonts.conf
link_file "$BASEDIR/alacritty.yml" ~/.config/alacritty/alacritty.yml
link_file "$BASEDIR/base16-atelier-heath-vim.theme" ~/.config/cmus/base16-atelier-heath-vim.theme
link_file "$BASEDIR/mousebright-config.json" ~/.config/mousebright/config.json
link_file "$BASEDIR/nvim-init.vim" ~/.config/nvim/init.vim
# and the stuff tucked away in .local (although right now it's just my fcitx5 addon,)
link_file "$BASEDIR/fcitx5/addon/awesome-hook.conf" ~/.local/share/fcitx5/addon/awesome-hook.conf
link_file "$BASEDIR/fcitx5/lua/awesome-hook" ~/.local/share/fcitx5/lua/awesome-hook
# finally, link directories
link_file "$BASEDIR/awesome" ~/.config/awesome