Skip to content

Instantly share code, notes, and snippets.

@phansch
Last active December 25, 2015 14:19
Show Gist options
  • Save phansch/6990647 to your computer and use it in GitHub Desktop.
Save phansch/6990647 to your computer and use it in GitHub Desktop.
Custom setup script.
#!/bin/bash
# Author: Philipp Hansch
#
# This script assumes Linux Mint 15 Xfce as a base distribution
# Make sure you have access to this script when you setup your system
# Use at your own risk.
aptget='sudo apt-get'
gh_user='phansch'
function pre_setup()
{
# Remove programs I don't need
# Run this before, to get app list: sed -nrs '/^\[Desktop Entry\]/d;/^(\[|Name=|Exec=)/p;${g;p}' /usr/share/applications/*.desktop > ~/Desktop/Names-n-Commands.txt
$aptget --purge remove -y libreoffice* thunderbird tomboy banshee gimp xfburn chromium-browser pidgin xchat
$aptget autoremove && sudo aptitude autoclean # Cleanup
## Add repositories
sudo add-apt-repository ppa:jd-team/jdownloader
sudo add-apt-repository ppa:pi-rho/dev # tmux 1.8
## Now upgrade
$aptget update && $aptget upgrade
}
function setup()
{
##########
## Base ##
##########
$aptget install -y python-setuptools libqt4-dbus libqt4-network libqt4-xml libasound2 libqt4-webkit
$aptget install -y git shutter redshift curl rxvt-unicode tmux zsh unclutter jdownloader-installer pavucontrol libgnome-keyring-dev
###########
## Skype ##
###########
cd /opt
sudo wget http://download.skype.com/linux/skype-ubuntu-precise_4.2.0.11-1_i386.deb
sudo dpkg -i skype-*
$aptget -f -y install
##########
## Anki ##
##########
sudo wget http://ankisrs.net/download/mirror/anki-2.0.13.deb
sudo dpkg -i anki*
$aptget -f -y install
################
## RVM + Ruby ##
################
cd ~ && \curl -L https://get.rvm.io | bash -s stable --ruby
source ~/.rvm/scripts/rvm
#########
## dwm ##
#########
$aptget install -y build-essential libx11-dev libxinerama-dev sharutils suckless-tools
cd /usr/local/src
sudo wget http://dl.suckless.org/dwm/dwm-6.0.tar.gz
sudo tar xvzf dwm-6.0.tar.gz
chown -R `id -u`:`id -g` dwm-6.0
cd dwm-6.0
sudo make clean install
$aptget install dwm
sudo cp /usr/share/xsessions/dwm.desktop{,.bak}
$aptget purge dwm
sudo mv /usr/share/xsessions/dwm.desktop{.bak,}
cd ~
#############
# oh-my-zsh #
#############
wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
}
function configure()
{
############################
## Dotfiles/Configuration ##
############################
git clone https://github.com/phansch/dotfiles.git ~/.dotfiles && cd ~/.dotfiles
git submodule update --init
./install.sh
wait # wait for configuration to finish
## Create symbolic link from .xsession to .xinitrc (needed for dwm to run)
ln -s ~/.xinitrc ~/.xsession
cd ~
## dwm config.h
mv /usr/local/src/dwm-6.0/config.h /usr/local/src/dwm-6.0/config.h.bak
wget https://raw.github.com/$gh_user/dwm/master/config.h
#####################
## Git/Development ##
#####################
# This section needs to be improved, maybe use different gemsets for each project.
mkdir ~/code && cd ~/code
getrepos=('Projects' 'jou' 'phansch.github.com' 'slides' 'latex-resume')
for repo in "$getrepos"
do
git clone https://github.com/$gh_user/$repo.git
done
## Setup local jekyll server for website clone
cd $gh_user.github.com
bundle install
cd ~
######################
## Fixes/Unbreaking ##
######################
## Fix gnome keyring for git (http://stackoverflow.com/questions/13385690/how-to-use-git-with-gnome-keyring-integration)
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring
}
function post_bt_sync()
{
## Sync symlink setup
ln -s ~/Sync/Documents ~
ln -s ~/Sync/Pictures ~
ln -s ~/Sync/Music ~
}
pre_setup
setup
configure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment