-
Notifications
You must be signed in to change notification settings - Fork 2
/
update.sh
executable file
·72 lines (65 loc) · 1.53 KB
/
update.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
#!/bin/sh
OS=$(uname)
dotfile() {
if [ -f "$HOME/.$1" ] ; then
if [ -L "$HOME/.$1" ] ; then
echo "File already linked: $1"
else
echo "File exists: $1. Probably you want to remove it and run update.sh again."
fi
else
ln -s "$HOME/dotfiles/$1" "$HOME/.$1"
echo "Linking file $1"
fi
}
dotlaunchagent() {
if [ -f "$HOME/Library/LaunchAgents/$1" ] ; then
if [ -L "$HOME/Library/LaunchAgents/$1" ] ; then
echo "LaunchAgent already linked: $1"
else
echo "LaunchAgent exists: $1. Probably you want to remove it and run update.sh again."
fi
else
ln -s "$HOME/dotfiles/LaunchAgents/$1" "$HOME/Library/LaunchAgents/$1"
echo "Linking file $1"
fi
}
dotdir() {
if [ -d "$HOME/.$1" ] ; then
if [ -L "$HOME/.$1" ] ; then
echo "Directory already linked: $1"
else
echo "Directory exists: $1. Probably you want to remove it and run update.sh again."
fi
else
ln -s "$HOME/dotfiles/$1" "$HOME/.$1"
echo "Linking directory $1"
fi
}
dotconfigdir() {
if [ -d "$HOME/.config/$1" ] ; then
if [ -L "$HOME/.config/$1" ] ; then
echo "Directory already linked: .config/$1"
else
echo "Directory exists: .config/$1. Probably you want to remove it and run update.sh again."
fi
else
ln -s "$HOME/dotfiles/$1" "$HOME/.config/$1"
echo "Linking directory .config/$1"
fi
}
# Common
dotfile gitconfig
dotfile zshrc
dotfile tmux.conf
dotfile latexmkrc
dotfile wezterm.lua
dotdir tmux
dotdir zsh
dotconfigdir ranger
dotconfigdir nvim
# Linux-specific
if [ "$OS" = "Linux" ] ; then
dotfile Xresources
dotdir mplayer
fi