-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·61 lines (48 loc) · 1.93 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
#!/usr/bin/env bash
HOME_DIR=~
CONFIG_INSTALL_DIR=$HOME_DIR/.config/
OHMYZSH_DIR=$HOME_DIR/.oh-my-zsh
OHMYTMUX_DIR=$HOME_DIR/.tmux
CWD=$(pwd)
# echo "$(tput setaf 2)WORKDIR: $CWD"
echo $(tput setaf 4)Hello!
# Install oh my zsh
[[ -z "${ZSH}" ]] && echo "$(tput setaf 3)Installing Oh My Zsh . . ." && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || echo "$(tput setaf 2)Oh My Zsh already installed."
# Install oh my tmux
if [[ -d "$OHMYTMUX_DIR" ]]; then
echo "$(tput setaf 2)Oh My Tmux already installed."
else
echo "$(tput setaf 3)Installing Oh My Tmux"
cd
git clone https://github.com/gpakosz/.tmux.git > /dev/null
ln -s -f .tmux/.tmux.conf
cd $CWD
fi
# Install dotfiles
echo "$(tput setaf 3)Copying dotfiles to $HOME_DIR . . ."
cp -r $CWD/dotfiles/. $HOME_DIR
# Install config
[ -d $CONFIG_INSTALL_DIR ] || mkdir $CONFIG_INSTALL_DIR
echo "$(tput setaf 3)Copying config files to $CONFIG_INSTALL_DIR . . ."
cp -r $CWD/config/* $CONFIG_INSTALL_DIR
### Install platform specific config
case "$(uname -s)" in
Linux*)
;;
Darwin*)
echo
echo "$(tput setaf 3)Detected Darwin, installing Darwin specific configs . . ."
# Install Übersicht
UBERSICHT_DIR="$HOME/Library/Application Support/Übersicht"
[[ ! -d $UBERSICHT_DIR ]] && echo "$(tput setaf 3)Installing Übersicht . . ." && brew install --cask ubersicht || echo "$(tput setaf 2)Übersicht already installed."
# Install Pecan
PECAN_DIR="$HOME/Library/Application Support/Übersicht/widgets/pecan"
mkdir -p $PECAN_DIR
[[ ! -d $PECAN_DIR ]] && echo "$(tput setaf 3)Installing Pecan . . ." && git clone https://github.com/zzzeyez/pecan.git "$PECAN_DIR" || echo "$(tput setaf 2)Pecan already installed."
# Install Pecan config
echo "$(tput setaf 3)Copying Pecan config to $PECAN_DIR . . ."
cp $CWD/pecan/* "$PECAN_DIR"
;;
esac
echo
echo "$(tput setaf 2)Done ✨"