-
Notifications
You must be signed in to change notification settings - Fork 9
/
ubuntu.sh
executable file
·135 lines (118 loc) · 5.8 KB
/
ubuntu.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env bash
installDocker() {
# Don't run this as root as you'll not add your user to the docker group
sudo apt update
sudo apt install apt-transport-https ca-certificates software-properties-common curl
# sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# echo deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -c | awk '{print $2}') main | sudo tee /etc/apt/sources.list.d/docker.list
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y "linux-image-extra-$(uname -r)"
sudo apt purge lxc-docker docker-engine docker.io
sudo rm -rf /etc/default/docker
sudo apt install -y docker-ce
sudo service docker start
sudo usermod -aG docker "${USER}"
}
installGnomeTerminalProfiles() {
# 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=boolean false
# Profiles from https://github.com/Mayccoll/Gogh
export {PROFILE_NAME,PROFILE_SLUG}="TomorrowNightBright" && wget -O xt https://raw.githubusercontent.com/Mayccoll/Gogh/master/themes/tomorrow-night-bright.sh && chmod +x xt && ./xt && rm xt
export {PROFILE_NAME,PROFILE_SLUG}="OneDark" && wget -O xt https://raw.githubusercontent.com/Mayccoll/Gogh/master/themes/one-dark.sh && chmod +x xt && ./xt && rm xt
export {PROFILE_NAME,PROFILE_SLUG}="MonokaiDark" && wget -O xt https://raw.githubusercontent.com/Mayccoll/Gogh/master/themes/monokai-dark.sh && chmod +x xt && ./xt && rm xt
export {PROFILE_NAME,PROFILE_SLUG}="SolarizedDark" && wget -O xt https://raw.githubusercontent.com/Mayccoll/Gogh/master/themes/solarized-dark.sh && chmod +x xt && ./xt && rm xt
export {PROFILE_NAME,PROFILE_SLUG}="GruvboxDark" && wget -O xt https://raw.githubusercontent.com/Mayccoll/Gogh/master/themes/gruvbox-derk.sh && chmod +x xt && ./xt && rm xt
}
installi3wm() {
if ! [ -x "$(command -v i3)" ]; then
sudo apt install i3 i3blocks i3status i3lock compton conky-all alsa-utils mpd mpc ncmpcpp feh lxappearance rxvt-unicode-256color x11-xserver-utils gtk-chtheme qt4-qtconfig xcalib xprintidle npm python-pip arandr
sudo pip install i3-cycle
sudo npm i -g i3-alt-tab
fi
mkdir -p "${HOME}"/.config/i3
cp -r files/config/i3/* "${HOME}/.config/i3/"
# if [ -x "$(command -v nautilus)" ] && [ ! -x "$(command -v nautilus-i3)" ]; then
# sudo cp files/nautilus-i3 /usr/bin/
# fi
if [ ! -s "${HOME}/.i3" ]; then
ln -s "${HOME}/.config/i3" "${HOME}/.i3"
fi
}
installCerebro() {
sudo npm install -g cerebro
sudo npm install -g cerebro-linux-system
sudo npm install -g cerebro-linux-commands
sudo npm install -g cerebro-shell
sudo npm install -g cerebro-fix-path
sudo npm install -g cerebro-clipboard
sudo npm install -g cerebro-kill
sudo npm install -g cerebro-timezones
sudo npm install -g cerebro-gif
sudo npm install -g cerebro-imdb
sudo npm install -g cerebro-ip
sudo npm install -g cerebro-emoj
sudo npm install -g cerebro-hash
sudo npm install -g cerebro-stackoverflow
sudo npm install -g cerebro-devdocs
}
addExtraRepos() {
# Google
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
# Spotify
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 0DF731E45CE24F27EEEB1450EFDC8610341D9410
echo 'deb http://repository.spotify.com stable non-free' | sudo tee /etc/apt/sources.list.d/spotify.list
# Skype
wget -q -O - https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -
echo 'deb [arch=amd64] https://repo.skype.com/deb stable main' | sudo tee /etc/apt/sources.list.d/skype-stable.list
# Azure
AZ_REPO=$(lsb_release -cs)
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
}
installPackages() {
if ! [ -x "$(command -v git)" ]; then
echo 'installing git!' >&2
sudo apt install git
fi
if ! [ -x "$(command -v hh)" ]; then
echo 'installing hh!' >&2
sudo add-apt-repository ppa:ultradvorka/ppa && sudo apt update && sudo apt install hh
fi
addExtraRepos
sudo apt update
cat files/pkgs/apt-core.lst | grep -v '^$\|^\s*\#' | tr '\n' ' ' | xargs sudo apt install -y
sudo apt-mark manual $(cat files/pkgs/apt-core.lst | grep -v '^$\|^\s*\#' | tr '\n' ' ')
# You might need some extra PPAs for these
cat files/pkgs/apt-extra.lst | grep -v '^$\|^\s*\#' | tr '\n' ' ' | xargs sudo apt install -y
sudo apt-mark manual $(cat files/pkgs/apt-extra.lst | grep -v '^$\|^\s*\#' | tr '\n' ' ')
if ! [ -x "$(command -v cerebro)" ]; then
installCerebro
fi
if ! [ -x "$(command -v docker)" ]; then
installDocker
fi
curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chefdk
sudo npm install -g coffeescrip
# sudo npm install -g azure-cli
installGnomeTerminalProfiles
}
case "$1" in
"packages" | "pkgs")
installPackages
;;
"termProfiles" | "gnomeTermProfiles" | "termColors")
installGnomeTerminalProfiles
;;
"i3wm" | "i3")
installi3wm
;;
*)
installPackages
;;
esac