Repository navigation
Expand file tree
/
Copy pathdotfiles.sh
More file actions
executable file
·66 lines (53 loc) · 1.54 KB
/
Copy pathdotfiles.sh
File metadata and controls
executable file
·66 lines (53 loc) · 1.54 KB
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
#!/usr/bin/env bash
./zsh/components/functions.sh
BIN_NAME=$(basename "$0")
COMMAND_NAME=$1
SUB_COMMAND_NAME=$2
DOTFILES_DIR="$HOME/.dotfiles"
help() {
echo "Usage: $BIN_NAME <command>"
echo
echo "Commands:"
echo " help This help message"
echo " reload Reload dotfiles"
echo " install Pull changes from repo and install new version"
}
reload() {
. ~/.zshrc && echo "Zsh reloaded."
}
install() {
[ -d "$DOTFILES_DIR/.git" ] && git --work-tree="$DOTFILES_DIR" --git-dir="$DOTFILES_DIR/.git" pull origin master
ln -sfv "$DOTFILES_DIR/zsh/.zshrc" ~
ln -sfv "$DOTFILES_DIR/zsh/.antigenrc" ~
ln -sfv "$DOTFILES_DIR/git/.gitconfig" ~
ln -sfv "$DOTFILES_DIR/git/.gitignore_global" ~
installAutomatorScripts;
installRectangle;
}
installAutomatorScripts() {
if is-osx; then
cp -R $DOTFILES_DIR/automator-scripts/* ~/Library/Services
fi
}
installRectangle() {
if is-osx; then
brew install --cask rectangle
mkdir -p ~/Library/Application\ Support/Rectangle/
cp ./rectangle/RectangleConfig.json ~/Library/Application\ Support/Rectangle/RectangleConfig.json
defaults write com.knollsoft.Rectangle almostMaximizeWidth -float 0.80
fi
}
case $COMMAND_NAME in
"" | "-h" | "--help")
help
;;
*)
shift
${COMMAND_NAME} $@
if [ $? = 127 ]; then
echo "'$COMMAND_NAME' is not a known command or has errors." >&2
help
exit 1
fi
;;
esac