-
Notifications
You must be signed in to change notification settings - Fork 2
/
install
executable file
·44 lines (38 loc) · 1.01 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
#!/bin/sh
source $(dirname $0)/.zshenv
if ! [ -d $ZPLUG_HOME ]; then
echo "Installing zplug...."
git clone https://github.com/zplug/zplug $ZPLUG_HOME
fi
function get_full_path {
echo $(realpath $(dirname $0)/$1)
}
mkdir ~/.local/share/zsh/
touch ~/.local/share/zsh/histfile
files=$(ls -ap $(get_full_path)| grep -v -E ".git*|/" | grep -E "^\.")
for dotfile in $files; do
path="$(get_full_path)/$dotfile"
rm -rf $HOME/$dotfile
link_args="$path $HOME"
ln -s $link_args
done
xdg_configs=$(ls $(get_full_path)/.config)
for dotfile in $xdg_configs; do
path="$(get_full_path)/.config/$dotfile"
rm -rf $HOME/.config/$dotfile
link_args="$path $HOME/.config/"
ln -s $link_args
done
xdg_data=$(ls $(get_full_path)/.local/share)
for dotfile in $xdg_data; do
path="$(get_full_path)/.local/share/$dotfile"
rm -rf $HOME/.local/share/$dotfile
link_args="$path $HOME/.local/share"
ln -s $link_args
done
if type feh &>/dev/null; then
fehbg
fi
if type feh &>/dev/null; then
fehbg
fi