Skip to content

Commit

Permalink
Major refactor of afterinstall.sh - now should be compatible with Ubu…
Browse files Browse the repository at this point in the history
…ntu Mate 16.04
  • Loading branch information
Patryk Małek committed Jun 15, 2016
1 parent cbdd321 commit cf4ad8c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ filetype off " required!
set encoding=utf-8
" -------------------------------------
" --------------- VUNDLE --------------
set rtp+=~/.vim/bundle/vundle/
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
" required!
Plugin 'gmarik/vundle'
Plugin 'VundleVim/Vundle.vim'

Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Expand Down
132 changes: 55 additions & 77 deletions afterinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,69 +31,38 @@ suretopurge(){
}

suretoinstall(){
echo -e "$col_yellow " && read -p "are you sure to install $1 ('y' to install)? " -n 1 -r ; echo -e "$col_reset"
if [[ $reply =~ ^[yy]$ ]]
echo -e "$COL_YELLOW " && read -p "Are you sure to install $1 ('y' to install)? " -n 1 -r ; echo -e "$col_reset"
if [[ $reply =~ ^[Yy]$ ]]
then
toinstall="$toinstall $1"
# sudo apt-get install $1 -y
fi
}

createdir ~/bin/
createdir ~/programming/node/
createdir ~/programming/scripts/
createdir ~/programming/{c,hackerrank,node,scripts}
createdir ~/.fonts/

suretopurge empathy
suretopurge shotwell-common
suretopurge eog
suretopurge thunderbird
suretoinstall samba
# gwenview instead of eog and shotwell for managing photos
suretoinstall gwenview
suretoinstall gimp
suretoinstall clementine

# Fixes Skype theme on 64 bit systems
if [[ `uname -m` =~ .*64.* ]] ; then
if [[ `uname -m` =~ .*64.* ]] ; then
toinstall="$toinstall gtk2-engines-murrine:i386"
fi

echo -e "$col_yellow " && read -p "Do you want to install Java Development Kit ('y' to install)? " -n 1 -r ; echo -e "$col_reset"
if [[ $reply =~ ^[Yy]$ ]]
then
toinstall="$toinstall oracle-jdk7-installer"
else
toinstall="$toinstall oracle-java7-installer"
fi

# purge unnecessary packages
sudo apt-get purge unity-scope-gdrive unity-scope-musicstores unity-scope-gmusicbrowser unity-lens-friends unity-scope-audacious unity-scope-guayadeque unity-scope-firefoxbookmarks unity-scope-virtualbox unity-scope-yelp unity-lens-video unity-lens-photos unity-lens-music unity-scope-chromiumbookmarks rhythmbox account-plugin-facebook account-plugin-aim account-plugin-windows-live account-plugin-flickr account-plugin-yahoo account-plugin-jabber account-plugin-salut brasero brasero-cdrkit brasero-common gnome-mahjongg unity-lens-photos unity-scope-openclipart unity-scope-musique unity-scope-colourlovers gnome-orca unity-scope-zotero unity-scope-tomboy unity-scope-texdoc transmission-common transmission-gtk unity-scope-video-remote totem account-plugin-twitter friends-twitter landscape-client-ui-install gnome-mines gnome-sudoku gnome-mahjongg $topurge -y

sudo apt-get install software-properties-common -y

# install clementine
sudo add-apt-repository ppa:me-davidsansome/clementine -y
# install tlp power management
sudo add-apt-repository ppa:linrunner/tlp -y
# add webupd8 PPA for java installation
sudo add-apt-repository ppa:webupd8team/java -y
# gimp updates yet not bleeding edge
sudo add-apt-repository ppa:otto-kesselgulasch/gimp -y
sudo apt-get purge unity-scope-gdrive unity-scope-musicstores unity-scope-gmusicbrowser unity-scope-audacious unity-scope-firefoxbookmarks unity-scope-virtualbox unity-scope-yelp unity-scope-chromiumbookmarks rhythmbox account-plugin-facebook account-plugin-aim account-plugin-windows-live account-plugin-flickr account-plugin-yahoo account-plugin-jabber account-plugin-salut brasero brasero-cdrkit brasero-common gnome-mahjongg unity-scope-openclipart unity-scope-musique unity-scope-colourlovers gnome-orca unity-scope-zotero unity-scope-tomboy unity-scope-texdoc transmission-common transmission-gtk unity-scope-video-remote totem account-plugin-twitter landscape-client-ui-install gnome-mines gnome-sudoku gnome-mahjongg empathy gimp clementine $topurge -y

# latest stable git release
sudo add-apt-repository ppa:git-core/ppa -y
# deluge team ppa
sudo add-apt-repository ppa:deluge-team/ppa -y

sudo apt-get update

# sudo apt-get install nvidia-331 -y
sudo apt-get install tlp tlp-rdw smartmontools ethtool -y
sudo tlp start

# install necessary
sudo apt-get install vim git unity-tweak-tool zsh indicator-multiload vlc rar ubuntu-restricted-extras tmux compizconfig-settings-manager compiz-plugins-extra indicator-cpufreq libappindicator1 python-pip htop deluge colormake xsel synaptic openssh-client openssh-server shutter $toinstall -y
sudo apt-get install software-properties-common vim-nox git zsh indicator-multiload vlc ubuntu-restricted-extras tmux compizconfig-settings-manager compiz-plugins-extra libappindicator1 python-pip htop deluge colormake xsel synaptic openssh-client openssh-server shutter curl $toinstall -V -y
sudo apt-get purge `dpkg -l | grep unity-lens | grep -v unity-lens-files | grep -v unity-lens-applications | awk '{print $2}'` -y
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y

# install chrome with dependencies
echo -e "$COL_YELLOW" && read -p "Are you sure to install google-chrome? " -n 1 -r ; echo -e "$COL_RESET"
Expand All @@ -112,13 +81,14 @@ fi
echo -e "$COL_YELLOW" && read -p "Are you sure to install vundle to manage your vim plugins? " -n 1 -r ; echo -e "$COL_RESET"
if [[ $REPLY =~ ^[Yy]$ ]]
then
git clone --depth 1 https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
echo -e "\n $COL_YELLOW Installing Vundle.vim ...\n $COL_RESET"
git clone --depth 1 https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
cp $DIR/.vimrc ~
cp $DIR/.tmux.conf ~
cp $DIR/.tmuxline.conf ~
sed -i 's/.*solarized.*/"\ &/g' ~/.vimrc
sed -i 's/colorscheme solarized/"\ &/g' ~/.vimrc
vim +PluginInstall +qall!
sed -i 's/"\ \(.*solarized.*\)/\1/g' ~/.vimrc
sed -i 's/"\ \(colorscheme solarized\)/\1/g' ~/.vimrc
vim +PluginInstall +qall!
ln -s ~/.vim/bundle/xmledit/ftplugin/xml.vim ~/.vim/bundle/xmledit/ftplugin/html.vim
fi
Expand All @@ -127,7 +97,7 @@ fi


# network speed indicator
cd ~/programming/scripts
cd ~/programming/scripts
wget http://webupd8.googlecode.com/files/sysmon_0.2.tar.gz && tar -xvf sysmon_0.2.tar.gz

# copy indicator-multiload config
Expand All @@ -136,8 +106,8 @@ sudo cp $DIR/preferences.ui /usr/share/indicator-multiload/preferences.ui

####################################################################
################# BEGIN OF OH-MY-ZSH
cd /tmp
wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh
echo -e "\n $COL_YELLOW Installing and configuring oh-my-zsh...\n $COL_RESET"
cd /tmp && wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh
cd ~
chsh -s /bin/zsh
sed -i 's@robbyrussell@af-magic@' ~/.zshrc
Expand All @@ -157,7 +127,7 @@ cat "$DIR/zshrc_methods" >> ~/.zshrc
( rm -rf ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && cd ~/.oh-my-zsh/custom/plugins && \
git clone --depth 1 git://github.com/zsh-users/zsh-syntax-highlighting.git 2> /dev/null && \
if ! grep -q zsh-syntax-highlighting ~/.zshrc; then sed -i -r 's#^(plugins=.*)\)#\1 zsh-syntax-highlighting)#' ~/.zshrc; fi && \
sed -i '/ZSH_HIGHLIGHT_.*/d' ~/.zshrc && \
sed -i '/ZSH_HIGHLIGHT_.*/d' ~/.zshrc

cat << EOF >> ~/.zshrc
Expand All @@ -177,37 +147,22 @@ echo "setopt magic_equal_subst" >> ~/.zshrc


####################################################################
############### Tmux and plugins
echo -e "\n $COL_YELLOW Installing tmux plugins...\n $COL_RESET"
git clone --depth 1 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm/
git clone --depth 1 https://github.com/tmux-plugins/tmux-copycat ~/.tmux/plugins/tmux-copycat/
git clone --depth 1 https://github.com/tmux-plugins/tmux-yank ~/.tmux/plugins/tmux-yank/

cat << EOF >> ~/.tmux.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
EOF
git clone --depth 1 https://github.com/tmux-plugins/tmux-resurrect ~/.tmux/plugins/tmux-resurrect/
git clone --depth 1 https://github.com/seebi/tmux-colors-solarized ~/.tmux/plugins/tmux-colors-solarized/
tmux source ~/.tmux.conf
####################################################################


####################################################################
############### Powerline fonts for gnome terminal
cd ~/.fonts/ && wget https://github.com/Lokaltog/powerline-fonts/archive/master.zip && unzip master.zip
mv powerline-fonts-master/* . && rm -rf master.zip powerline-fonts-master
fc-cache -vf ~/.fonts
( cd ~/.fonts/ && wget https://github.com/Lokaltog/powerline-fonts/archive/master.zip && unzip master.zip && \
mv powerline-fonts-master/* . && rm -rf master.zip powerline-fonts-master && fc-cache -vf ~/.fonts
gconftool-2 --set /apps/gnome-terminal/profiles/Default/font --type string "Ubuntu Mono derivative Powerline 11"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_system_font --type bool "false"
gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_system_font --type bool "false" )

echo -e "$COL_YELLOW" && read -p "Do you want to set tmux as your default terminal command? (y to confirm) " -n 1 -r ; echo -e "$COL_RESET"
if [[ $REPLY =~ ^[Yy]$ ]]
Expand All @@ -222,24 +177,24 @@ fi
############## fix ubuntu privacy fixubuntu.com
############## Figure out the version of Ubuntu that you're running
V=`/usr/bin/lsb_release -rs`

# The privacy problems started with 12.10, so earlier versions should do nothing
if [ $V \< 12.10 ]; then
echo "\nGood news! Your version of Ubuntu doesn't invade your privacy.\n"
else
# Turn off "Remote Search", so search terms in Dash don't get sent to the internet
gsettings set com.canonical.Unity.Lenses remote-content-search none

# If you're using earlier than 13.10, uninstall unity-lens-shopping
if [ $V \< 13.10 ]; then
sudo apt-get remove -y unity-lens-shopping

# If you're using a later version, disable remote scopes
else
gsettings set com.canonical.Unity.Lenses disabled-scopes \
"['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"
fi;

# Block connections to Ubuntu's ad server, just in case
if ! grep -q productsearch.ubuntu.com /etc/hosts; then
echo -e "\n127.0.0.1 productsearch.ubuntu.com" | sudo tee -a /etc/hosts >/dev/null
Expand All @@ -250,24 +205,47 @@ fi


# remove amazon from dash
sudo rm -rf /usr/share/applications/ubuntu-amazon-default.desktop
sudo rm -rf /usr/share/applications/ubuntu-amazon-default.desktop 2>/dev/null

# disable overlay scrollbars
gsettings set com.canonical.desktop.interface scrollbar-mode normal

# disable guest login
echo allow-guest=false | sudo tee -a /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf
# disable guest login
[[ -s " /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf" ]] && \
echo allow-guest=false | sudo tee -a /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf

# disable crash reports
sudo sed -i 's/enabled=1/enabled=0/' /etc/default/apport
[[ -s "/etc/default/apport" ]] && sudo sed -i 's/enabled=1/enabled=0/' /etc/default/apport

# check updates each 2 weeks
dconf write /com/ubuntu/update-notifier/regular-auto-launch-interval 14

# DOES NOT WORK ?
# DOES NOT WORK ?
#sudo xhost +SI:localuser:lightdm
#sudo su lightdm -s /bin/bash
#gsettings set com.canonical.unity-greeter draw-grid false



################################################################
echo -e "\n $COL_YELLOW Installing gvm and go...\n $COL_RESET"
sudo apt-get install bison -y
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) && \
source /home/monkey/.gvm/scripts/gvm && \
gvm install go1.4 && gvm use go1.4 && export GOROOT_BOOTSTRAP=$GOROOT && \
gvm install go1.6.2 && gvm use go1.6.2 && gvm uninstall go1.4
cat << EOF >> ~/.zshrc
[[ -s "/home/monkey/.gvm/scripts/gvm" ]] && source "/home/monkey/.gvm/scripts/gvm"
gvm use go1.6.2 >/dev/null
EOF
################################################################

################################################################
echo -e "\n $COL_YELLOW Installing silver_searcher - ag...\n $COL_RESET"
sudo apt-get install automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev -y
cd /tmp && git clone --depth 1 https://github.com/ggreer/the_silver_searcher.git ag && cd ag && \
./build.sh >/dev/null 2>&1
################################################################

cd $current_dir
echo -e "\n $COL_YELLOW Configuration complete :). Enjoy!\n $COL_RESET"

0 comments on commit cf4ad8c

Please sign in to comment.