-
Notifications
You must be signed in to change notification settings - Fork 61
/
oh-my-cygwin.sh
executable file
·40 lines (28 loc) · 996 Bytes
/
oh-my-cygwin.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
#!/bin/bash
set -e
# cd home
cd ~
SIMPLE_BACKUP_SUFFIX=".orig"
APT_CYG="$(mktemp /tmp/apt-cyg.XXXXXXXX)"
# install apt-cyg
wget --no-check-certificate "https://github.com/john-peterson/apt-cyg/raw/path/apt-cyg" -O "${APT_CYG}"
chmod +x "${APT_CYG}"
# install some stuff like vim and git
"${APT_CYG}" install zsh mintty vim curl git openssh
# install OH MY ZSH
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
# Create initial /etc/zshenv
[[ ! -e /etc/zshenv ]] && echo export PATH=/usr/bin:\$PATH > /etc/zshenv
install --backup ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
#setting up vim
VIMRC_EXAMPLE=`find /usr/share/vim -type f -name vimrc_example.vim | head -n 1`
if [ ! -f ~/.vimrc ] && [ -n "${VIMRC_EXAMPLE}" ]
then
install "${VIMRC_EXAMPLE}" ~/.vimrc
fi
# install apt-cyg
install --backup "${APT_CYG}" /bin/apt-cyg
# setting up zsh as default
sed -i "s/$USER\:\/bin\/bash/$USER\:\/bin\/zsh/g" /etc/passwd
# et voila just start it
/usr/bin/env zsh